public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: svlu@enea.se To: gcc-gnats@gcc.gnu.org Cc: karm@enea.se, steby@enea.se Subject: optimization/7232: Incorrect code generate for volatiles and -O2 Date: Mon, 08 Jul 2002 05:36:00 -0000 [thread overview] Message-ID: <20020708123354.18969.qmail@sources.redhat.com> (raw) >Number: 7232 >Category: optimization >Synopsis: Incorrect code generate for volatiles and -O2 >Confidential: no >Severity: critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Mon Jul 08 05:36:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Sven Lundblad / OSE Systems >Release: gcc 3.1 >Organization: >Environment: Solaris hosted cross compiler for powerpc and mips >Description: When the code below is compiled with gcc 3.1 and -O2, for at least powerpc and mips, the second load instruction is incorrect during the next pointer update (the same value is reloaded instead of follow the pointer). It seams to be related to the use of the volatile keyword. If compiled with just -O it works fine. This is a regression from gcc 2.95 which worked fine. >How-To-Repeat: Compile the gcc_bug1.c file with -S -O2 and examine the output. >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="gcc_bug1.c" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="gcc_bug1.c" dHlwZWRlZiBzdHJ1Y3QgYV9saW5rX3N0cnVjdAp7CiAgdW5zaWduZWQgaW50ICBhOwogIHVuc2ln bmVkIGludCAgYjsKICB1bnNpZ25lZCBpbnQgIGM7CiAgdW5zaWduZWQgaW50ICBkOwogIHVuc2ln bmVkIGludCAgZTsKICB1bnNpZ25lZCBpbnQgIGY7CiAgdW5zaWduZWQgaW50ICBnOyAgCgogIHN0 cnVjdCBhX2xpbmtfc3RydWN0ICpuZXh0OwogICAgICAKICB2b2lkICAgICAgICAqICBpOyAgCiAg dW5zaWduZWQgaW50ICAgajsKICB1bnNpZ25lZCBzaG9ydCBrOwogIHVuc2lnbmVkIGNoYXIgIGw7 CiAgdW5zaWduZWQgY2hhciAgbTsKICBzaWduZWQgICBjaGFyICBuOwp9CmFfbGluazsKCnR5cGVk ZWYgc3RydWN0IEZyZWVMaXN0U3RydWN0CnsKICBpbnQgICAgICAgZHVtbXk7CiAgc3RydWN0IEZy ZWVMaXN0U3RydWN0ICpuZXh0Owp9IEZyZWVMaXN0OwoKc3RydWN0IGxpc3Rfd2l0aF9GcmVlTGlz dAp7CiAgaW50IGR1bW15OwogIGludCBkdW1teTI7CiAgRnJlZUxpc3QgICAgICAgICp2b2xhdGls ZSBydEZyZWVMaXN0OyAvKiA8LS0gVm9sYXRpbGUgdHJpZ2dlcnMgdGhlIGJ1Zy4gKi8KfTsKCnN0 cnVjdCBsaXN0X3dpdGhfRnJlZUxpc3QgbGw7CgpzdGF0aWMgYV9saW5rICpmb3JjZV9nY2NfcHBj X2J1Zyh2b2lkKTsKCnN0YXRpYwphX2xpbmsgKmZvcmNlX2djY19wcGNfYnVnKHZvaWQpCnsKICBG cmVlTGlzdCAqZnJlZU5vZGU7CiAgYV9saW5rICAgICpsbms7CiAgCiAgIC8qIHBvcCBvbmUgbm9k ZSAqLwogICBmcmVlTm9kZSA9IGxsLnJ0RnJlZUxpc3Q7CiAgIGxsLnJ0RnJlZUxpc3QgPSBsbC5y dEZyZWVMaXN0LT5uZXh0OwogICBmcmVlTm9kZS0+bmV4dCA9IDA7CgogICBsbmsgICAgPSAoYV9s aW5rICopIGZyZWVOb2RlOwogICBsbmstPmEgPSAweDEyMzQ7CiAgIGxuay0+bCA9IDB4MTI7Cgog ICByZXR1cm4gbG5rOwp9Cgo=
next reply other threads:[~2002-07-08 12:36 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-07-08 5:36 svlu [this message] 2002-07-08 6:06 Franz Sirl 2002-07-09 1:47 sirl
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=20020708123354.18969.qmail@sources.redhat.com \ --to=svlu@enea.se \ --cc=gcc-gnats@gcc.gnu.org \ --cc=karm@enea.se \ --cc=steby@enea.se \ /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: linkBe 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).