Line numbers in SUIF 2 ???
"Kunal Kalra" <[email protected]> Fri, 13 Apr 2007 17:02:56 +0530
| Newsgroups | gmane.comp.compilers.suif.bugs |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_4460_6354598.1176463976938
Content-Type: multipart/alternative;
boundary="----=_Part_4461_31534152.1176463976938"
------=_Part_4461_31534152.1176463976938
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
There're a lot of problems with the original line annotations which SUIF
inserts...
Consider the following small sample program (fib.c):
1 /*Another simple test program*/
2
3 int fib(int n)
4 {
5 int a = 0, b;
6 b = 1;
8 while( n > 0)
9 {
10 a = b;
11 b = a + b;
12 n--;
13 }
14 return b;
15 }
7
It produces the following fib.out.c
/* Architecture is Linux */
typedef int (*__cp_1) (int );
int fib(int );
int fib(int n)
{
int a;
int b;
int _fibTmp2;
/*#line 3 "
fib.c"*/
a = (0);
/*#line 6 "fib.c"*/
b = (1);
/*#line 12 "fib.c"*/
while ( (n> 0) ) {
_fibTmp0:;
/*#line 10 "
fib.c"*/
a = (b);
/*#line 11 "fib.c"*/
b = ((a+b));
/*#line 12 "fib.c"*/
_fibTmp2 = (n);
/*#line 12 "
fib.c"*/
n = ((_fibTmp2- 1));
}
/*#line 14 "fib.c"*/
return b ;
}
See line 5, and line 8 in original program. They have been incorrectly
portrayed as line 3 and line 12 in the fib.out.c
Also, in more complex program, the "line" annote is even missing on many
statements....
I'm sorry, I havent seen the archive of suif-bugs, but I have googled a lot
on the net, and have only seen queries, but no solutions to this problem.
Also, I realize that SUIF's front end (c2suif) is based on the EDG front
end. So the bug probably might be in the EDG front end.
But can anyone suggest, what is the work-around for this?
Thanks and regards,
Kunal Kalra
Department of Computer Science and Engg,
Indian Institute of Technology, Delhi
------=_Part_4461_31534152.1176463976938
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
<span class="q"><br>There're a lot of problems with the original line annotations which SUIF inserts...
<br><br>Consider the following small sample program (fib.c):<br><font size="4"><br></font></span><pre><font size="4"><span class="q"> 1 /*Another simple test program*/<br> 2<br> 3 int fib(int n)<br> 4 {
<br> 5 int a = 0, b;<br><br> 6 b = 1;<br><br></span><span class="q"> 8 while( n > 0)<br> 9 {<br> 10 a = b;<br> 11 b = a + b;<br> 12 n--;<br>
13 }<br> 14 return b;<br> 15 }</span></font>
7</pre><div><span class="e" id="q_111eab6c734060f6_5">It produces the following
fib.out.c<br><br><pre><font size="4">/* Architecture is Linux */<br>typedef int (*__cp_1) (int );<br><br>int fib(int );<br><br><br><br>int fib(int n)<br>{<br> int a;<br> int b;<br> int _fibTmp2;<br>
<br><br>/*#line 3 "<br>fib.c"*/<br> a = (0);<br> <br>/*#line 6 "fib.c"*/<br> b = (1);<br> <br>/*#line 12 "fib.c"*/<br> while ( (n> 0) ) {<br> _fibTmp0:;<br> <br>
<br><br>/*#line 10 "<br>fib.c"*/<br> a = (b);<br> <br>/*#line 11 "fib.c"*/<br> b = ((a+b));<br> <br>/*#line 12 "fib.c"*/<br> _fibTmp2 = (n);<br>
<br>/*#line 12 "<br>fib.c"*/<br><br> n = ((_fibTmp2- 1));<br> }<br> <br>/*#line 14 "fib.c"*/<br> return b ;<br><br>}</font></pre><br>See line 5, and line 8 in original program. They have been incorrectly portrayed as line 3 and line 12 in the
fib.out.c<br><br></span></div>Also, in more complex program, the "line" annote is even missing on many statements.... <br>I'm sorry, I havent seen the archive of suif-bugs, but I have googled a lot on the net, and have only seen queries, but no solutions to this problem.
<br><br>Also, I realize that SUIF's front end (c2suif) is based on the EDG front end. So the bug probably might be in the EDG front end. <br>But can anyone suggest, what is the work-around for this? <br><br><span><span class="q">
<br>Thanks and regards,<br>Kunal Kalra<br><br></span>Department of Computer Science and Engg,<br>Indian Institute of Technology, Delhi <br><br><br></span><br clear="all">
<br clear="all">
------=_Part_4461_31534152.1176463976938--
------=_Part_4460_6354598.1176463976938
Content-Type: text/x-csrc; name=fib.c; charset=ANSI_X3.4-1968
Content-Transfer-Encoding: base64
X-Attachment-Id: f_eza2gqxo
Content-Disposition: attachment; filename="fib.c"
LypBbm90aGVyIHNpbXBsZSB0ZXN0IHByb2dyYW0qLwoKaW50IGZpYihpbnQgbikKewoJaW50IGEg
PSAwLCBiOwoJYiA9IDE7CgoJd2hpbGUoIG4gPiAwKQoJewoJCWEgPSBiOwoJCWIgPSBhICsgYjsK
CQluLS07Cgl9CglyZXR1cm4gYjsKfQo=
------=_Part_4460_6354598.1176463976938
Content-Type: text/x-csrc; name=fib.out.c; charset=ANSI_X3.4-1968
Content-Transfer-Encoding: base64
X-Attachment-Id: f_eza2h1jy
Content-Disposition: attachment; filename="fib.out.c"
LyoJQXJjaGl0ZWN0dXJlIGlzIExpbnV4ICovCnR5cGVkZWYgaW50ICgqX19jcF8xKSAoaW50ICAp
OwoKaW50ICBmaWIoaW50ICApOwoKCgoKCmludCAgZmliKGludCAgbikKewogICAgaW50ICBhOwog
ICAgaW50ICBiOwogICAgaW50ICBfZmliVG1wMjsKICAgIAovKiNsaW5lIDMgImZpYi5jIiovCiAg
ICBhID0gKDApOwogICAgCi8qI2xpbmUgNiAiZmliLmMiKi8KICAgIGIgPSAoMSk7CiAgICAKLyoj
bGluZSAxMiAiZmliLmMiKi8KICAgIHdoaWxlICggKG4+IDApICkgewogICAgICAgIF9maWJUbXAw
OjsKICAgICAgICAKICAgICAgICAKLyojbGluZSAxMCAiZmliLmMiKi8KICAgICAgICBhID0gKGIp
OwogICAgICAgIAovKiNsaW5lIDExICJmaWIuYyIqLwogICAgICAgIGIgPSAoKGErYikpOwogICAg
ICAgIAovKiNsaW5lIDEyICJmaWIuYyIqLwogICAgICAgIF9maWJUbXAyID0gKG4pOwogICAgICAg
IAovKiNsaW5lIDEyICJmaWIuYyIqLwogICAgICAgIG4gPSAoKF9maWJUbXAyLSAxKSk7CiAgICAg
ICAgfQogICAgCi8qI2xpbmUgMTQgImZpYi5jIiovCiAgICByZXR1cm4gYiA7CiAgICAKfQoK
------=_Part_4460_6354598.1176463976938
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
To unsubscribe, send mail to [email protected]
or visit http://suif.stanford.edu/mailman/listinfo/suif-bugs
------=_Part_4460_6354598.1176463976938--