re PR fortran/59706 (ICE with do concurrent and internal subprogram)
authorJakub Jelinek <jakub@redhat.com>
Fri, 17 Jan 2014 20:55:42 +0000 (21:55 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 17 Jan 2014 20:55:42 +0000 (21:55 +0100)
PR middle-end/59706
* gimplify.c (gimplify_expr): Use create_tmp_var
instead of create_tmp_var_raw.  If cond doesn't have
integral type, don't add the IFN_ANNOTATE builtin at all.

* gfortran.dg/pr59706.f90: New test.
* g++.dg/ext/pr59706.C: New test.

From-SVN: r206732

gcc/ChangeLog
gcc/gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/pr59706.C [new file with mode: 0644]
gcc/testsuite/gfortran.dg/pr59706.f90 [new file with mode: 0644]

index 7bf573300077701aca83ca6b2795cfdc101908e9..0240d7eb03f1f587518e6242de1bd30163bf89c6 100644 (file)
@@ -1,3 +1,10 @@
+2014-01-17  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/59706
+       * gimplify.c (gimplify_expr): Use create_tmp_var
+       instead of create_tmp_var_raw.  If cond doesn't have
+       integral type, don't add the IFN_ANNOTATE builtin at all.
+
 2014-01-17  Martin Jambor  <mjambor@suse.cz>
 
        PR ipa/59736
index 202d084f09fbfd3bc277fea29e83b3981502e134..9c9998dd1939ae8869a3861bec379a6861ad3b55 100644 (file)
@@ -7491,7 +7491,14 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
          {
            tree cond = TREE_OPERAND (*expr_p, 0);
            tree id = TREE_OPERAND (*expr_p, 1);
-           tree tmp = create_tmp_var_raw (TREE_TYPE(cond), NULL);
+           tree type = TREE_TYPE (cond);
+           if (!INTEGRAL_TYPE_P (type))
+             {
+               *expr_p = cond;
+               ret = GS_OK;
+               break;
+             }
+           tree tmp = create_tmp_var (type, NULL);
            gimplify_arg (&cond, pre_p, EXPR_LOCATION (*expr_p));
            gimple call = gimple_build_call_internal (IFN_ANNOTATE, 2,
                                                      cond, id);
index c471ae98aa948aa24cdb49e24be51a9f3720a3cd..be4aa901eca3377cc3a7ca1331525232e0294ae5 100644 (file)
@@ -1,3 +1,9 @@
+2014-01-17  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/59706
+       * gfortran.dg/pr59706.f90: New test.
+       * g++.dg/ext/pr59706.C: New test.
+
 2014-01-17  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/59270
diff --git a/gcc/testsuite/g++.dg/ext/pr59706.C b/gcc/testsuite/g++.dg/ext/pr59706.C
new file mode 100644 (file)
index 0000000..b82b45e
--- /dev/null
@@ -0,0 +1,21 @@
+// PR middle-end/59706
+// { dg-do compile }
+
+extern struct S s;
+struct T { T (); ~T (); int t; } t;
+
+void
+foo ()
+{
+  #pragma GCC ivdep
+  while (s)    // { dg-error "could not convert" }
+    ;
+}
+
+void
+bar ()
+{
+  #pragma GCC ivdep
+  while (t)    // { dg-error "could not convert" }
+    ;
+}
diff --git a/gcc/testsuite/gfortran.dg/pr59706.f90 b/gcc/testsuite/gfortran.dg/pr59706.f90
new file mode 100644 (file)
index 0000000..64a7de5
--- /dev/null
@@ -0,0 +1,10 @@
+! PR middle-end/59706
+! { dg-do compile }
+
+  integer i
+  do concurrent (i=1:2)
+  end do
+contains
+  subroutine foo
+  end 
+end