This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to supress a specific kind of ansi-aliasing rules?


On 6/20/07 9:09 AM, Bokhanko, Andrey S wrote:

> Yes, but one can write something like this:
> 
> p2 = (S1 *)&p1->s1_m2;
> 
> Of course, this is a blatant violation of ANSI C standard, etc. Still, a
> perfectly acceptable C code.

No, it isn't.  GCC only tries to DTRT on standard compliant code.

> With violations of other ANSI aliasing rules, one has an exit:
> -fno-strict-aliasing option. No so in this case.

We don't have a switch to disable CSE at the RTL level (which is the
pass doing this structural analysis).  Volatile is just about the only
thing that will help you here.

Having said that, maybe we could consider having CSE not doing this with
-fno-strict-aliasing, but I'm not sure if it's a good idea.  What do
others think?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]