]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* tree-ssa-dom.c (initialize_hash_element): Fix oversight.
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 28 Jun 2011 21:56:48 +0000 (21:56 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 28 Jun 2011 21:56:48 +0000 (21:56 +0000)
From-SVN: r175602

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 896b560acf7597d5def124764807272207674cfb..e21f3750672ebd8edc3cd7999bbecdcd495643c6 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-17  Hans-Peter Nilsson  <hp@axis.com>
 
        Backport from mainline
index ee72cd1c06642c97d6bbf69648e82dae5032cc8a..2f86305b65df70cece05a09597199331f1072570 100644 (file)
@@ -1,3 +1,7 @@
+2011-06-28  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/opt17.ad[sb]: New test.
+
 2011-06-23  Jason Merrill  <jason@redhat.com>
 
        PR c++/49440
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 8b799a3bd1f4d0b534fef3523e421d05d03d110c..1b67ccddc2b6f19ea76a0e382a6eca846d20e31e 100644 (file)
@@ -215,6 +215,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: