This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/31130] [4.3 Regression] VRP no longer derives range for division after negation
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Mar 2007 05:43:11 -0000
- Subject: [Bug tree-optimization/31130] [4.3 Regression] VRP no longer derives range for division after negation
- References: <bug-31130-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from pinskia at gcc dot gnu dot org 2007-03-12 05:43 -------
- if (supports_overflow_infinity (TREE_TYPE (expr)))
- min = positive_overflow_infinity (TREE_TYPE (expr));
- else
- {
- set_value_range_to_varying (vr);
- return;
- }
+ /* Negating TYPE_MIN_VALUE gives us a minimum value of
+ positive overflow infinity, and there is nothing useful
+ we can do with such a range. */
+ set_value_range_to_varying (vr);
This seems to introduce another missed optimization regression:
int f(int a)
{
if (a < 0)
a = -a;
return a < 0;
}
A more complex example is where you do abs twice:
int f(int a)
{
if (a < 0)
a = -a;
if (a < 0)
a = -a;
return a < 0;
}
The second abs should be removed in VRP but now it will not be removed.
-- Pinski who is upset at all these changes to VRP. Also who is upset we
change GCC for people who don't know the language they are writting in.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31130