An alias bug

David S. Miller davem@dm.cobaltmicro.com
Mon Jul 13 00:12:00 GMT 1998


   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



More information about the Gcc-bugs mailing list