This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/58742] pointer arithmetic simplification
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 21 Jan 2014 12:15:06 +0000
- Subject: [Bug middle-end/58742] pointer arithmetic simplification
- Auto-submitted: auto-generated
- References: <bug-58742-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58742
--- Comment #15 from Marc Glisse <glisse at gcc dot gnu.org> ---
Another example: http://stackoverflow.com/q/21253690/1918193
where we have (-DVERSION=2):
_128 = img$_M_impl$_M_start_130 + 4000000;
pretmp_146 = (long intD.12) _128;
pretmp_145 = (long intD.12) img$_M_impl$_M_start_130;
pretmp_76 = pretmp_146 - pretmp_145;
pretmp_121 = pretmp_76 /[ex] 4;
pretmp_120 = (size_typeD.24047) pretmp_121;
We miss that pretmp_120 is a constant, VRP thus fails to eliminate the range
checks, vectorization doesn't happen, and the code is more that 4 times slower
than it should be.
If the desired reassoc version is hard, a simple forwprop pattern matching
would already go a long way to alleviate this issue.