[PATCH] Fix PR 28807 - wrong code with may_alias and structs
Andrew Pinski
pinskia@physics.uc.edu
Thu Aug 24 15:32:00 GMT 2006
The problem here is that access_can_touch_variable would return false
for accesses via a base which has an aliasing set of 0 which is
incorrect. Anyways this fixes the problem by checking the aliasing set
to make sure that does not happen.
I added a testcase to the testsuite for a possible missed optimization
which Daniel Berlin had caught with an earlier version of this patch.
OK? Bootstrapped and tested on i686-linux-gnu with no regressions.
Thanks,
Andrew Pinski
PS. The testcase for testing if this works fails at "-O3 -g" currently
but it is fails with an ICE which was also there before my patch. I
filed the bug under PR 28834 and also noticed it is a regression.
ChangeLog:
* tree-ssa-operands.c (access_can_touch_variable): Don't say
the access through a base which has an alias set of 0 cannot
touch the variable.
testsuite/ChangeLog:
* gcc.c-torture/execute/mayalias-2.c: New test.
* gcc.dg/tree-ssa/alias-13.c: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixpr28807.diff.txt
Type: text/x-patch
Size: 1731 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060824/e80b3580/attachment.bin>
More information about the Gcc-patches
mailing list