------- Comment #1 from rguenth at gcc dot gnu dot org  2010-08-08 12:35 -------
Err.  Exchange - (-__INT_MAX__ - 1) for + (-__INT_MAX__ - 1) and see that
fold is fine and only reassoc is broken, but requires a way more complex
testcase.

extern void abort (void);
int i = 1;
int main()
{
  int j = i - 1;
  j = j + (-__INT_MAX__ - 1);
  if (j != (-__INT_MAX__ - 1))
    abort ();
  return 0;
}

$ diff -u t.c.084t.dse1 t.c.085t.reassoc1 
--- t.c.084t.dse1       2010-08-08 14:34:08.000000000 +0200
+++ t.c.085t.reassoc1   2010-08-08 14:34:08.000000000 +0200
@@ -8,8 +17,7 @@

 <bb 2>:
   i.0_1 = i;
-  j_2 = i.0_1 + -1;
-  j_3 = j_2 + -2147483648;
+  j_3 = i.0_1 + 2147483647;
   if (j_3 != -2147483648)
     goto <bb 3>;
   else


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45232

Reply via email to