public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Bruce Korb <bkorb@pacbell.net> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: c/8083: GCC 3.2 Optimization bug Date: Sat, 28 Sep 2002 16:56:00 -0000 [thread overview] Message-ID: <20020928235601.32361.qmail@sources.redhat.com> (raw) The following reply was made to PR c/8083; it has been noted by GNATS. From: Bruce Korb <bkorb@pacbell.net> To: gcc-gnats@gcc.gnu.org, bkorb@gnu.org Cc: Subject: Re: c/8083: GCC 3.2 Optimization bug Date: Sat, 28 Sep 2002 16:55:18 -0700 The following diff of the routine works, so clearly it is an aliasing optimization issue. It looks like the optimizer presumesthat "list" is not modified by the line: *ppT = pDef; *However*, since "ppT" is explicitly set to point to "list", it is clearly an alias and not one to be optimized away. diff -u -r3.7 defReduce.c --- defReduce.c 15 Jun 2002 18:24:59 -0000 3.7 +++ defReduce.c 28 Sep 2002 23:32:03 -0000 @@ -121,9 +121,10 @@ YYSTYPE def, YYSTYPE list ) { + tDefEntry* ret = (tDefEntry*)list; tDefEntry* pDef = (tDefEntry*)def; - tDefEntry* pScn = (tDefEntry*)list; - tDefEntry** ppT = (tDefEntry**)&list; + tDefEntry* pScn = ret; + tDefEntry** ppT = &ret; for (;;) { if (strcmp( pDef->pzDefName, pScn->pzDefName ) == 0) { @@ -166,9 +169,8 @@ * THEN put the new entry at the start of the list */ if (pScn->pNext == NULL) { - pDef->pNext = (tDefEntry*)list; - list = def; + ret = (tDefEntry*)def; break; } @@ -181,7 +183,7 @@ pScn = pScn->pNext; } - return list; + return (YYSTYPE)ret; }
next reply other threads:[~2002-09-28 23:56 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-09-28 16:56 Bruce Korb [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-10-01 12:22 nathan 2002-09-29 11:19 nathan 2002-09-28 15:56 Bruce Korb 2002-09-28 15:06 Bruce Korb 2002-09-28 14:56 bkorb
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=20020928235601.32361.qmail@sources.redhat.com \ --to=bkorb@pacbell.net \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@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).