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/32145] [pointer_plus] Ice in build2_stat, at tree.c:3074



------- Comment #2 from pinskia at gcc dot gnu dot org  2007-05-29 19:49 -------
I have a fix, just getting a reduced testcase (the ICE comes from VRP).
The fix is:
Index: ../../gcc/tree-vrp.c
===================================================================
--- ../../gcc/tree-vrp.c        (revision 125036)
+++ ../../gcc/tree-vrp.c        (working copy)
@@ -1482,10 +1482,14 @@ extract_range_from_assert (value_range_t
                    }
                  max = negative_overflow_infinity (TREE_TYPE (var_vr->min));
                }
-             else
+             else if (!POINTER_TYPE_P (TREE_TYPE (var_vr->min)))
                max = fold_build2 (MINUS_EXPR, TREE_TYPE (var_vr->min),
                                   anti_min,
                                   build_int_cst (TREE_TYPE (var_vr->min), 1));
+             else
+               max = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (var_vr->min),
+                                  anti_min,
+                                  size_int (-1));
              min = real_min;
              set_value_range (vr_p, VR_RANGE, min, max, vr_p->equiv);
            }


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   GCC host triplet|i686-gnu-linux              |
 GCC target triplet|                            |i686-gnu-linux
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2007-05-29 19:49:11
               date|                            |


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


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