http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54935



Richard Biener <rguenth at gcc dot gnu.org> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

                 CC|                            |hubicka at gcc dot gnu.org,

                   |                            |rguenth at gcc dot gnu.org



--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> 2012-10-15 
14:06:16 UTC ---

We cannot if-convert this because the store to a[i] may trap as it may be

in .rodata.



That is, the following is valid C:



t1.c:

const int a[100];

const int b[100];



t2.c:

your testcase



with LTO we could arrange information on readonly-ness of variables to be

available.  Honza, is there already a suitable predicate for this?



If other compilers do this transformation without LTO they can be trivially

tricked to generate wrong code.

Reply via email to