Hi,

the attached testcase triggers an ICE when compiled at -O or above, on all the 
open branches.  This is a regression introduced with the tuplification.  The 
problem is that 2 ARRAY_RANGE_REFs are recognized as equivalent, although they 
don't have the same number of elements.  This is so because their type isn't 
taken into account by the hash equality function as it simply isn't recorded 
in initialize_hash_element (GIMPLE_SINGLE_RHS case).  Now in all the other 
cases it is recorded so this very likely is an oversight.

Tested on x86_64-suse-linux, OK for all branches?


2011-06-28  Eric Botcazou  <ebotca...@adacore.com>

        * tree-ssa-dom.c (initialize_hash_element): Fix oversight.


2011-06-28  Eric Botcazou  <ebotca...@adacore.com>

        * gnat.dg/opt17.ad[sb]: New test.


-- 
Eric Botcazou
Index: tree-ssa-dom.c
===================================================================
--- tree-ssa-dom.c	(revision 175408)
+++ tree-ssa-dom.c	(working copy)
@@ -214,6 +214,7 @@ initialize_hash_element (gimple stmt, tr
         {
         case GIMPLE_SINGLE_RHS:
 	  expr->kind = EXPR_SINGLE;
+	  expr->type = TREE_TYPE (gimple_assign_lhs (stmt));
 	  expr->ops.single.rhs = gimple_assign_rhs1 (stmt);
 	  break;
         case GIMPLE_UNARY_RHS:
-- { dg-do compile }
-- { dg-options "-O" }

package body Opt17 is

  function Func return S is
    V : String (1 .. 6);
  begin
    V (1 .. 3) := "ABC";
    return V (1 .. 5);
  end;

end Opt17;
package Opt17 is

  subtype S is String (1 .. 5);

  function Func return S;

end Opt17;

Reply via email to