This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: An alias bug
- To: law at cygnus dot com
- Subject: Re: An alias bug
- From: "David S. Miller" <davem at dm dot cobaltmicro dot com>
- Date: Sun, 12 Jul 1998 23:43:52 -0700
- CC: hjl at lucon dot org, egcs-bugs at cygnus dot com, mark at markmitchell dot com
- References: <10983.900310103@hurl.cygnus.com>
Date: Mon, 13 Jul 1998 00:08:23 -0600
From: Jeffrey A Law <law@hurl.cygnus.com>
It works by accident, not by design.
The testcase is simply wrong and broken. I'm not planning any attempt
to fix it, nor am I likely to approve a patch to fix that test.
Then gcc should refuse to compile it.
I don't mind if we want to be able to optimize better by being able to
make alias analysis decisions based upon what the C standard says we
can determine about pointer references etc.
But if we're going to produce (in the user's eye) erroneous code, we
should tell him his code is broken so he doesn't get a surprise later.
This is especially true since previous versions of gcc (and all vendor
compilers I've checked so far) compile this sort of code just fine,
even HJ's particular example.
Or does GCC right now warn about such illegal things with the proper
-W options enabled?
Later,
David S. Miller
davem@dm.cobaltmicro.com