Hi,

this is the ICE at -O2 on ACATS c34005a introduced on the 4.6 branch by 
Martin's latest SRA patch.  But it's actually the same PRE issue as:
  http://gcc.gnu.org/ml/gcc-patches/2011-03/msg02210.html

Bootstrapped/regtested on i586-suse-linux, OK for 4.6 branch?


2011-07-14  Eric Botcazou  <ebotca...@adacore.com>

        PR tree-optimization/49725
        Backport from mainline
        2011-03-31  Eric Botcazou  <ebotca...@adacore.com>

        * tree-ssa-pre.c (create_component_ref_by_pieces_1) <ARRAY_REF>: Drop
        a zero minimum index only if it is redundant
        


-- 
Eric Botcazou
Index: tree-ssa-pre.c
===================================================================
--- tree-ssa-pre.c	(revision 176264)
+++ tree-ssa-pre.c	(working copy)
@@ -2874,8 +2874,11 @@ create_component_ref_by_pieces_1 (basic_
 	  return NULL_TREE;
 	if (genop2)
 	  {
-	    /* Drop zero minimum index.  */
-	    if (tree_int_cst_equal (genop2, integer_zero_node))
+	    tree domain_type = TYPE_DOMAIN (TREE_TYPE (genop0));
+	    /* Drop zero minimum index if redundant.  */
+	    if (integer_zerop (genop2)
+		&& (!domain_type
+		    || integer_zerop (TYPE_MIN_VALUE (domain_type))))
 	      genop2 = NULL_TREE;
 	    else
 	      {

Reply via email to