]> 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 22:00:00 +0000 (22:00 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 28 Jun 2011 22:00:00 +0000 (22:00 +0000)
From-SVN: r175603

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 8dafef711f74fbbf6e07f2eafd29082f2c9ef82a..e164ed90ce905d8cf3323f2c7ff72512ed2b282f 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-20  Andrey Belevantsev  <abel@ispras.ru>
 
        Backport from mainline
index f0c4342233f8429a8380bb89946b590d85e09ffa..6022ac354fb24b773729a2315013a7d267c82822 100644 (file)
@@ -1,3 +1,7 @@
+2011-06-28  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/opt17.ad[sb]: New test.
+
 2011-06-20  Andrey Belevantsev  <abel@ispras.ru>
 
        Backport from mainline
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 a9fddbe97d495b5b1ca383ee5a1c84ea2e1b3ec9..6b080383532dfbd19d4e97fcc063b7e24291c6d0 100644 (file)
@@ -231,6 +231,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: