How to supress a specific kind of ansi-aliasing rules?
Diego Novillo
dnovillo@google.com
Wed Jun 20 14:17:00 GMT 2007
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?
More information about the Gcc
mailing list