public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: savage@light-speed.de
To: gcc-gnats@gcc.gnu.org
Cc: gcc-bugs@gcc.gnu.org
Subject: optimization/6988: __asm__ __volatile__ disappears
Date: Mon, 10 Jun 2002 19:06:00 -0000	[thread overview]
Message-ID: <20020611015706.22154.qmail@sources.redhat.com> (raw)


>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"

H4sIAEVYB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VPUHVX9QpVoCxDB2/0/zYwyJYiAqo7uPGFUhs4NU71roupdMMfPf+mVTfbMnOwWP43m/T7yb
60xvdEnYDdefQli/Ea8knIt+5OOwMM2q2kn4RPbaOjfQqhua9TuJX1Tr0ezxkyv1x1aVGH2+lmVr
OZ8+fJiTyacff54S7t2EhKsnmc/I5Ce4jj5nLVnk5f5IIo8pg1kcTB3zKjcwMDAwMDAwMDAwMDAw
MDAwMDAwMDAwMPgP4St9HxpFACgAAA==


             reply	other threads:[~2002-06-11  2:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-10 19:06 savage [this message]
2002-06-14 16:25 rth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020611015706.22154.qmail@sources.redhat.com \
    --to=savage@light-speed.de \
    --cc=gcc-bugs@gcc.gnu.org \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).