This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/54935] No way to do if converison
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 15 Oct 2012 14:06:16 +0000
- Subject: [Bug tree-optimization/54935] No way to do if converison
- Auto-submitted: auto-generated
- References: <bug-54935-4@http.gcc.gnu.org/bugzilla/>
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.