* tree-ssa-dom.c (initialize_hash_element): Fix oversight.
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 28 Jun 2011 21:50:06 +0000 (21:50 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 28 Jun 2011 21:50:06 +0000 (21:50 +0000)
From-SVN: r175600

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/opt17.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/opt17.ads [new file with mode: 0644]
gcc/tree-ssa-dom.c

index 00991f77d9372f31ec7157bab25af46a5b04f0f9..588a0b586eb45a72540e592abee2c8dabdeab217 100644 (file)
@@ -1,3 +1,7 @@
+2011-06-28  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * tree-ssa-dom.c (initialize_hash_element): Fix oversight.
+
 2011-06-28  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * config/sparc/sol2-64.h (TARGET_DEFAULT): Remove.
 
 2011-06-27  Jan Hubicka  <jh@suse.cz>
 
-       * ipa.c (cgraph_address_taken_from_non_vtable_p): Walk references of node
-       instead of references in node.
+       * ipa.c (cgraph_address_taken_from_non_vtable_p): Walk references of
+       node instead of references in node.
 
 2011-06-27  Richard Henderson  <rth@redhat.com>
 
        PR tree-optimize/49373
        * tree-pass.h (all_late_ipa_passes): Declare.
        * cgraphunit.c (init_lowered_empty_function): Fix properties.
-       (cgraph_optimize): Execute late passes; remove unreachable funcions after
-       materialization.
-       * ipa-inline.c (gate_ipa_inline): Enable only when optimizing or LTOing.
+       (cgraph_optimize): Execute late passes; remove unreachable funcions
+       after materialization.
+       * ipa-inline.c (gate_ipa_inline): Enable only when optimizing or
+       LTOing.
        * passes.c (all_late_ipa_passes): Declare.
        (dump_passes, register_pass): Handle late ipa passes.
-       (init_optimization_passes): Move ipa_pta to late passes; schedule fixup_cfg
-       at beggining of all_passes.
+       (init_optimization_passes): Move ipa_pta to late passes; schedule
+       fixup_cfg at beggining of all_passes.
        (apply_ipa_transforms): New function.
        (execute_one_pass): When doing simple ipa pass, apply all transforms.
 
index 3139ebafda5f81ecb3a7820a3d722849972e1d9f..46419f307fd1653ac3a11e24aab80060a0bf3a49 100644 (file)
@@ -1,3 +1,7 @@
+2011-06-28  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/opt17.ad[sb]: New test.
+
 2011-06-28  Janis Johnson  <janisjo@codesourcery.com>
            Tom de Vries  <tom@codesourcery.com>
 
diff --git a/gcc/testsuite/gnat.dg/opt17.adb b/gcc/testsuite/gnat.dg/opt17.adb
new file mode 100644 (file)
index 0000000..361f760
--- /dev/null
@@ -0,0 +1,13 @@
+-- { 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;
diff --git a/gcc/testsuite/gnat.dg/opt17.ads b/gcc/testsuite/gnat.dg/opt17.ads
new file mode 100644 (file)
index 0000000..601c2f2
--- /dev/null
@@ -0,0 +1,7 @@
+package Opt17 is
+
+  subtype S is String (1 .. 5);
+
+  function Func return S;
+
+end Opt17;
index f41d7eca5626c4bd19b71c51e689a3faf93e1a08..bbfe0bc8338ce4a3e7caeff16272d6750a5380f2 100644 (file)
@@ -214,6 +214,7 @@ initialize_hash_element (gimple stmt, tree lhs,
         {
         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: