[PATCH] FIx PR 28812, wrong code with strict aliasing, struct and mayalias

Andrew_Pinski@PlayStation.Sony.Com Andrew_Pinski@PlayStation.Sony.Com
Fri Nov 10 04:24:00 GMT 2006


Hi,
  The problem here is that we decide that the struct (whos aliasing set is 
0) set cannot 
interfer with the access to the local variable.  This is wrong because the 
aliasing set of the memory
access of the struct so we know it can interfer with the local variable. 
This problem is like mayalias-2.c
which caused a problem on the tree level but this causes a problem for the 
RTL level.

This patch fixes the problem by checking if the aliasing set of the struct 
memory access is not 0.

OK? Bootstrapped and tested on i686-linux-gnu with no regressions.

Note like mayalias-2.c, this testcase also ICEs at "-O3 -g".

Thanks,
Andrew Pinski

ChangeLog:

        * alias.c (fixed_scalar_and_varying_struct_p): Don't return a non
        null value if the struct memory access is in the 0th aliasing set.


        * gcc.c-torture/execute/mayalias-3.c: New test.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fixmayalias.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20061110/833df47c/attachment.txt>


More information about the Gcc-patches mailing list