re PR middle-end/71526 (ICE: verify_gimple failed)
authorRichard Biener <rguenther@suse.de>
Tue, 14 Jun 2016 13:47:01 +0000 (13:47 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 14 Jun 2016 13:47:01 +0000 (13:47 +0000)
2016-06-14  Richard Biener  <rguenther@suse.de>

PR middle-end/71526
* genmatch.c (expr::gen_transform): Use in_type for comparisons
if available.

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

From-SVN: r237441

gcc/ChangeLog
gcc/genmatch.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr71526.f90 [new file with mode: 0644]

index 68366635e7a22e4dc8e097d70507681d760fe7ca..82a84fa22c8a04d8156d13b4429dae23bb9a5cc6 100644 (file)
@@ -1,3 +1,9 @@
+2016-06-14  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/71526
+       * genmatch.c (expr::gen_transform): Use in_type for comparisons
+       if available.
+
 2015-06-14  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * config/aarch64/aarch64.c (aarch64_mask_and_shift_for_ubfiz_p):
index 9bb1279dc0021d45a837e3877997fe50efa8b673..f5aa29b72f5e205959eb12617ccd923bc65c76d7 100644 (file)
@@ -2288,8 +2288,14 @@ expr::gen_transform (FILE *f, int indent, const char *dest, bool gimple,
     {
       /* comparisons use boolean_type_node (or what gets in), but
          their operands need to figure out the types themselves.  */
-      sprintf (optype, "boolean_type_node");
-      type = optype;
+      if (in_type)
+       type = in_type;
+      else
+       {
+         sprintf (optype, "boolean_type_node");
+         type = optype;
+       }
+      in_type = NULL;
     }
   else if (*opr == COND_EXPR
           || *opr == VEC_COND_EXPR)
index 248064d311c22b7809a73fa49c1cbe74aee32558..30e53be74703a82c4588abe2bbd398f8171f9f95 100644 (file)
@@ -1,3 +1,8 @@
+2016-06-14  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/71526
+       * gfortran.dg/pr71526.f90: New testcase.
+
 2016-06-14  Andre Vieira  <andre.simoesdiasvieira@arm.com>
 
        * gcc.dg/zero_bits_compound-1.c: Support aarch64.
diff --git a/gcc/testsuite/gfortran.dg/pr71526.f90 b/gcc/testsuite/gfortran.dg/pr71526.f90
new file mode 100644 (file)
index 0000000..dbf989f
--- /dev/null
@@ -0,0 +1,21 @@
+! { dg-do link }
+! { dg-require-effective-target lto }
+! { dg-options "-O2 -flto" }
+
+MODULE util
+  INTERFACE sort
+     MODULE PROCEDURE sort_cv
+  END INTERFACE
+CONTAINS
+  SUBROUTINE sort_cv ( arr, n, index )
+    CHARACTER(LEN=*), INTENT(INOUT)          :: arr(1:n)
+    INTEGER, INTENT(OUT)                     :: INDEX(1:n)
+    INTEGER, ALLOCATABLE, DIMENSION(:, :)    :: entries
+    ALLOCATE(entries(max_length,SIZE(arr)))
+  END SUBROUTINE sort_cv
+END MODULE util
+USE util
+INTEGER, ALLOCATABLE :: ind(:)
+character(len=3), ALLOCATABLE :: d(:)
+CALL sort(d,N,ind)
+END