public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: kostis@csd.uu.se To: gcc-gnats@gcc.gnu.org Cc: ebotcazou@libertysurf.fr, kostis@csd.uu.se Subject: target/10222: Wrong code with -mcpu=ultrasparc using gcc 3.2.2 Date: Wed, 26 Mar 2003 14:16:00 -0000 [thread overview] Message-ID: <20030326140605.28352.qmail@sources.redhat.com> (raw) >Number: 10222 >Category: target >Synopsis: Wrong code with -mcpu=ultrasparc using gcc 3.2.2 >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Wed Mar 26 14:16:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Kostis Sagonas >Release: version 3.2.2 >Organization: >Environment: Solaris 9 (probably on all Solaris versions) >Description: The attached file contains a very small and simple function extracted from a big application. The code produced by -03 is correct. The code produced using -03 -mcpu=ultrasparc is wrong and causes the application to go into an infinite loop. >From what I can see, the problem is partly caused by the fact that the code lies about types when it appends elements to the free list. My guess is that -mcpu=ultrasparc triggers a scheduling pass, which assumes one store cannot affect another load, since they are of different types. I can pass -fno-strict-aliasing to gcc to work around that, but arguably this is unsatisfactory for various reasons: 1. What I naively expect from -mcpu=ultrasparc is to perform target specific code generation; not to affect the alias analysis which is used. 2. This behaviour is not something that happened with previous versions of gcc (e.g. 2.95.x) and gcc 3.2 on x86 with -mcpu=pentiumpro does not exhibit such behaviour. >How-To-Repeat: Compile using: gcc -c -O3 -S file.c gcc -c -O3 -mcpu=ultrasparc -S file.c >Fix: IMHO, -mcpu=... should not imply a specific sort of alias analysis. >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="tr_reclaim.c" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="tr_reclaim.c" c3RydWN0IHN1YmdvYWxfZnJhbWUgewogIHN0cnVjdCBjb21wbGV0aW9uX3N0YWNrX2ZyYW1lICpj b21wbF9zdGFja19wdHI7Cn07CgpzdHJ1Y3QgY29tcGxldGlvbl9zdGFja19mcmFtZSB7CiAgc3Ry dWN0IEFuc3dlcl9MaXN0X05vZGUgKmRlbF9yZXRfbGlzdDsKfTsKCnN0cnVjdCBBbnN3ZXJfTGlz dF9Ob2RlIHsKICBzdHJ1Y3QgQW5zd2VyX0xpc3RfTm9kZSAqbGluazsKfTsKCnN0cnVjdCBTdHJ1 Y3R1cmVfTWFuYWdlciB7CiAgc3RydWN0IHsKICAgIHZvaWQgKmRlYWxsb2M7CiAgfSBzdHJ1Y3Rf bGlzdHM7Cn07CmV4dGVybiBzdHJ1Y3QgU3RydWN0dXJlX01hbmFnZXIgc21BTE47Cgp2b2lkIHJl Y2xhaW1fZGVsX3JldF9saXN0KHN0cnVjdCBzdWJnb2FsX2ZyYW1lICpzZ19mcmFtZSkKewogIHN0 cnVjdCBBbnN3ZXJfTGlzdF9Ob2RlICp4LCAqeTsKICAKICB4ID0gc2dfZnJhbWUtPmNvbXBsX3N0 YWNrX3B0ci0+ZGVsX3JldF9saXN0OwogIHdoaWxlICh4KSB7CiAgICB5ID0geDsKICAgIHggPSB4 LT5saW5rOwogICAgKih2b2lkKiopeSA9IHNtQUxOLnN0cnVjdF9saXN0cy5kZWFsbG9jOwogICAg c21BTE4uc3RydWN0X2xpc3RzLmRlYWxsb2MgPSB5OwogIH0KfQoK
next reply other threads:[~2003-03-26 14:16 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-03-26 14:16 kostis [this message] 2003-03-30 21:17 Eric Botcazou
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=20030326140605.28352.qmail@sources.redhat.com \ --to=kostis@csd.uu.se \ --cc=ebotcazou@libertysurf.fr \ --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: 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).