This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/31130] [4.3 Regression] VRP no longer derives range for division after negation



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]