This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/69526] ivopts candidate strangeness
- From: "rdapp at linux dot vnet.ibm.com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 20 May 2016 14:30:21 +0000
- Subject: [Bug middle-end/69526] ivopts candidate strangeness
- Auto-submitted: auto-generated
- References: <bug-69526-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69526
--- Comment #13 from rdapp at linux dot vnet.ibm.com ---
Created attachment 38535
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38535&action=edit
VRP/match.pd patch
Found some time again and hacked together a fix for match.pd and VRP. The patch
exports a VRP function no_range_overflow that is called from match.pd via
tree.c. I realize that VRP didn't export any functions so far and if there's a
better/idiomatic way to do it, please tell me. Further improvements or "code
smell" hints very welcome.
Currently this should fix cases like
long foo(int i)
{
return (long) (i + 1) - 2;
}
Commutativity of a PLUS_EXPR is not yet being exploited and I'm relying on
TYPE_OVERFLOW_UNDEFINED so far. The overflow checking could also be done more
elegantly I suppose.
This diff is extracted from the full patch which also includes the RTL level
fix which I haven't included here since it has not changed. I hope the
splitting didn't introduce new bugs but there are no regressions on s390x for
the full patch.