public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/6988: __asm__ __volatile__ disappears
@ 2002-06-14 16:25 rth
  0 siblings, 0 replies; 2+ messages in thread
From: rth @ 2002-06-14 16:25 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, savage

Synopsis: __asm__ __volatile__ disappears

State-Changed-From-To: open->closed
State-Changed-By: rth
State-Changed-When: Fri Jun 14 16:21:48 2002
State-Changed-Why:
    Not a bug.  Re-read the bit in the manual
    concerning unreachable code.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6988


^ permalink raw reply	[flat|nested] 2+ messages in thread

* optimization/6988: __asm__ __volatile__ disappears
@ 2002-06-10 19:06 savage
  0 siblings, 0 replies; 2+ messages in thread
From: savage @ 2002-06-10 19:06 UTC (permalink / raw)
  To: gcc-gnats; +Cc: gcc-bugs


>Number:         6988
>Category:       optimization
>Synopsis:       __asm__ __volatile__ disappears
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 10 19:06:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Jens Troeger
>Release:        gcc 2.96-85 (RedHat 7.1)
>Organization:
>Environment:
Linux i686, Kernel 2.4.9-31custom (RedHat)
>Description:
this particular version of (RH-homemade) gcc simply
"optimizes" away __asm__ __volatile__ instructions,
and emits code that is unable to handle &&Llabel 
arithmetic. further, the inline assembly is moved around to a wrong place. compile the code with 

  gcc -S -g3 -O0 test.c

and you will see. i attach both, an example c file,
as well as the emitted asm file.
>How-To-Repeat:
------------------ test.c

int main(int argc, char* argv[]) {
 
        int len = &&Lend - &&Lstart;
        return 0;
 
Lstart:
        __asm__ __volatile__ ("nop; nop");
Lend:
        (void)0;
}

---------------------- test.s
see .L3 and .L4 

main:
        .stabn 68,0,2,.LM1-main
.LM1:
.LBB2:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $4, %esp
        .stabn 68,0,4,.LM2-main
.LM2:
        movl    $.L3, %eax
        subl    $.L4, %eax
        movl    %eax, -4(%ebp)
        .stabn 68,0,5,.LM3-main
.LM3:
        movl    $0, %eax
.L4:
.L3:
        .stabn 68,0,11,.LM4-main
.LM4:
.LBE2:
        leave
        ret
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/x-gzip; name="src.tgz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="src.tgz"

H4sIAEVYBT0AA+1WXW/bNhTNq/QrCKEr7EJWSIr6iIUARYquffD2MGBPwyDINuMIkCVDkg13w/57
76UoRZntdBuQDMN4Ephf95x7SV5SbGXTequrFwVllIZCXFFAFHYl020EZ+EVjQLKeOBHQQT2TNDg
itCXDavDvmmzmpCrJjtkG/mcnayb1wjodWHnZUu2WV5OsJLVm5VLVg9Z/Q7rh19+nZLfbdvCsUKW
5Ja8fbuQ5ZrMsIIr1ya2Vct2X5eEJrbd9c1tK02zZpumJE0PVZG1eSGhMXHKapcQ+HGmiY1CYDk5
VPl6CuQ/bPvfXo3/H1o8/y+c1984/4JivT//UXf+fW7O/2vA8u7hbFqOyoOVY1veAeaZV6XlUOZR
5tgeLNCyIc71Q7WV190yXTsu7KmLf96ilceWDmZa6HQcC1u34Nh39pazWa14uqq2Owhj7TkuoUcf
7iDa/Q+ycAPN2wl12fS2VkUy40xEIvZDESdDNUrAM4+V50cyXmiKzTs2nyY0Yfy8cVGVG9K78zuC
/7fc7csm35RyPaiITkWA2zGghfmucTmYE72g0wv+od6TGYbT2/dNKJJa1RM8q2eQ0OgcvuHjJPBo
5Cw6iZ79dR/NQ1W3g2yMsixUsjFslc+jME7w9zn2SXQ3I5kbTJEwCPzgvELHHBKLUeTGigr1ZAaU
ixk2OH6ksxGdoWsenHd8X1SZPgl8OAoCCOeM19V+WcjO2h+s4wvWasvGFDFQGL/AwYNbyOOwhAxS
s4lrmRVzxQRjnyf5Ntvots+x41mt0RRDHUF4OeqeNQ480jRIMdjO53kns441GRKJX1rYNF3u86LN
y/SQpUXe6HAhgd7h9QLJ0BVjruVlBWw7EYMKPrvm36t1cVw/BCvuYt9ggM+x+U4bsJAqi3g8fFDD
nGnHXJcjc8Ztb1NUy0K98iCK9stOWqrhvr/fl6sWLntbhaIv5ZKEsaJ6ix/YrAsIanP4vbvjYLXb
Nw+F9Z1c7mxrWx2w2uxc0nU0sJLWG4HNZvdUUaAiHxRRStHfeAsf7bNjT/cWou/QDrKjS2Zigj6m
T1UDVPUHVX9QpVoCxDB2/0/zYwyJYiAqo7uPGFUhs4NU71roupdMMfPf+mVTfbMnOwWP43m/T7yb
60xvdEnYDdefQli/Ea8knIt+5OOwMM2q2kn4RPbaOjfQqhua9TuJX1Tr0ezxkyv1x1aVGH2+lmVr
OZ8+fJiTyacff54S7t2EhKsnmc/I5Ce4jj5nLVnk5f5IIo8pg1kcTB3zKjcwMDAwMDAwMDAwMDAw
MDAwMDAwMDAwMPgP4St9HxpFACgAAA==


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-06-14 23:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-14 16:25 optimization/6988: __asm__ __volatile__ disappears rth
  -- strict thread matches above, loose matches on Subject: below --
2002-06-10 19:06 savage

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).