This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/71654] [6/7 Regression] missing VRP optimization on c++ unsigned char and short expressions
- 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: Fri, 24 Jun 2016 19:46:20 +0000
- Subject: [Bug middle-end/71654] [6/7 Regression] missing VRP optimization on c++ unsigned char and short expressions
- Auto-submitted: auto-generated
- References: <bug-71654-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71654
Marc Glisse <glisse at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2016-06-24
Summary|missing VRP optimization on |[6/7 Regression] missing
|c++ unsigned char and short |VRP optimization on c++
|expressions |unsigned char and short
| |expressions
Ever confirmed|0 |1
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
_1 = (intD.9) i_3(D);
if (_1 <= 3)
[...]
_5 = i_3(D) & 4;
So we know stuff about the range of _1, but we don't transfer that information
to i_3. Far from the first time I see something like this in VRP :-(
We could optimize _1 <= 3 to i_3(D) <= 3, and in this case it should help, but
IIRC there are also cases where it hurts (if we use _1 later on and don't move
the definition of _1 after the condition...). Here the failure is because we
were inconsistent about narrowing, forwprop changed (int)i & 4 to (int)(i & 4)
but not (int)i <= 3 to i <= 3. I get return 0" if I disable the first 2
forwprop passes.