public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Zack Weinberg <zack@codesourcery.com>
To: Bruce Korb <bkorb@pacbell.net>
Cc: gcc@gcc.gnu.org
Subject: Re: module level flags
Date: Sat, 28 Sep 2002 20:56:00 -0000	[thread overview]
Message-ID: <20020929010601.GB1288@codesourcery.com> (raw)
In-Reply-To: <3D9642A2.77470B36@pacbell.net>

On Sat, Sep 28, 2002 at 05:00:34PM -0700, Bruce Korb wrote:
> Zack Weinberg wrote:
> > 
> > On Sat, Sep 28, 2002 at 04:46:21PM -0700, Bruce Korb wrote:
> 
> > If you've found an optimizer bug in 3.[12] not present in 3.0 and
> > prior, you could have the courtesy to *tell us what it is* so we can
> > *fix* it.
> 
> OK:  :-)  Meanwhile, I have determined it was caused by failing
> to recognize a valid alias.

I'm afraid the compiler is working as designed.

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

In the original code, the type-based aliasing rules permit the
compiler to assume that assignment to ppT does not modify list
EVEN THOUGH IT IS OBVIOUS TO A HUMAN THAT IT DOES.

Your fix is the right way to correct your code.  By immediately
assigning list to a temporary with its true type, you show the
compiler what's really going on.

zw

  reply	other threads:[~2002-09-29  1:06 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-28 16:41 Bruce Korb
2002-09-28 16:52 ` Tim Prince
2002-09-28 16:53   ` Bruce Korb
2002-09-28 18:06     ` Zack Weinberg
2002-09-28 18:20       ` Bruce Korb
2002-09-28 20:56         ` Zack Weinberg [this message]
2002-09-28 22:08           ` Bruce Korb
2002-09-29 15:46             ` Geoff Keating
2002-09-29  3:20       ` Robert Dewar
2002-09-29 11:55         ` Zack Weinberg
2002-09-29 13:10           ` Bruce Korb
2002-09-29 13:59             ` Zack Weinberg
2002-09-29 17:21     ` Tom Tromey
2002-09-29  6:40 Robert Dewar
2002-09-29 10:05 ` Bruce Korb
2002-09-29 10:17   ` Gabriel Dos Reis
2002-09-29 10:45     ` Bruce Korb
2002-09-29 11:36       ` Gabriel Dos Reis
2002-09-29 13:06       ` Daniel Jacobowitz
2002-09-29 13:08         ` Bruce Korb
2002-09-29 13:21           ` Daniel Jacobowitz
2002-09-29 10:49   ` Russ Allbery
2002-09-30 21:33   ` Alexandre Oliva
2002-09-30 21:42     ` Bruce Korb
2002-09-29 10:31 Robert Dewar
2002-09-29 10:45 Robert Dewar
2002-09-29 13:36 Robert Dewar
2002-09-29 13:38 ` Bruce Korb
2002-09-29 14:05   ` Russ Allbery
2002-09-29 13:38 Robert Dewar
2002-09-29 13:42 Robert Dewar
2002-09-29 14:52 ` Russ Allbery
2002-09-29 14:03 Robert Dewar
     [not found] <orn0py67ug.fsf@free.redhat.lsd.ic.unicamp.br>
2002-10-01 11:33 ` Joe Buck
2002-10-01 12:16   ` Geoff Keating
2002-10-05 21:03     ` Kai Henningsen
2002-10-06  6:36       ` Gabriel Dos Reis
2002-10-06  8:25         ` Nathan Sidwell
2002-10-06  8:29           ` Gabriel Dos Reis
2002-10-01 12:29   ` Bruce Korb
2002-10-01 14:14     ` Alexandre Oliva
2002-10-01 14:25   ` Alexandre Oliva
2002-10-03 16:46     ` Joe Buck
2002-10-03 17:34       ` Zack Weinberg
2002-10-03 18:07         ` Richard Henderson
2002-10-01 13:58 Robert Dewar
2002-10-01 14:54 ` Joe Buck
2002-10-01 15:40   ` Michael Matz
2002-10-05 11:36 ` Toon Moene
2002-10-02  0:53 Robert Dewar

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=20020929010601.GB1288@codesourcery.com \
    --to=zack@codesourcery.com \
    --cc=bkorb@pacbell.net \
    --cc=gcc@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).