re PR tree-optimization/85082 (ICE with -Ofast in vn_reference_insert_pieces, at...
authorRichard Biener <rguenther@suse.de>
Tue, 27 Mar 2018 12:13:55 +0000 (12:13 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 27 Mar 2018 12:13:55 +0000 (12:13 +0000)
2018-03-27  Richard Biener  <rguenther@suse.de>

PR tree-optimization/85082
* tree-ssa-sccvn.c (vn_reference_lookup_or_insert_for_pieces):
Valueize the VUSE.

* gfortran.dg/pr85082.f90: New testcase.

From-SVN: r258877

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr85082.f90 [new file with mode: 0644]
gcc/tree-ssa-sccvn.c

index e4f0ff515bb32a43b511d77002888c20a46b699f..55c1f279d685dcd376fbedbe7d862e214b2a2a58 100644 (file)
@@ -1,3 +1,9 @@
+2018-03-27  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/85082
+       * tree-ssa-sccvn.c (vn_reference_lookup_or_insert_for_pieces):
+       Valueize the VUSE.
+
 2018-03-27  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
 
        * config.gcc (aarch64*-*-linux*): New TARGET_DEFAULT_ASYNC_UNWIND_TABLES
index b6517f45310320e6d05aed7a32361432fe66045c..06d08aaa5389d17c5dfda4d2532202ea322b31a0 100644 (file)
@@ -1,3 +1,8 @@
+2018-03-27  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/85082
+       * gfortran.dg/pr85082.f90: New testcase.
+
 2018-03-27  Chenghua Xu  <paul.hua.gm@gmail.com>
 
        * gcc.target/mips/umips-stroe16-2.c: Change "length = 2"
diff --git a/gcc/testsuite/gfortran.dg/pr85082.f90 b/gcc/testsuite/gfortran.dg/pr85082.f90
new file mode 100644 (file)
index 0000000..13fff37
--- /dev/null
@@ -0,0 +1,14 @@
+! { dg-do compile }
+! { dg-options "-Ofast" }
+program p
+   real(4) :: a, b
+   integer(4) :: n, m
+   equivalence (a, n)
+   a = 1024.0
+   m = 8
+   a = 1024.0
+   b = set_exponent(a, m)
+   n = 8
+   a = f(a, n)
+   b = set_exponent(a, m)
+end
index 9844bbbbcf361ad76c93cfb2d757d10e27f9d7e7..fea452bd132033795b98358f8e4bb11d38a1502f 100644 (file)
@@ -1631,7 +1631,7 @@ vn_reference_lookup_or_insert_for_pieces (tree vuse,
   vn_reference_s vr1;
   vn_reference_t result;
   unsigned value_id;
-  vr1.vuse = vuse;
+  vr1.vuse = vuse ? SSA_VAL (vuse) : NULL_TREE;
   vr1.operands = operands;
   vr1.type = type;
   vr1.set = set;