]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/60267 (ICE in c_pp_lookup_pragma, at c-family/c-pragma.c:1232; ICE in tsubs...
authorJakub Jelinek <jakub@redhat.com>
Wed, 19 Feb 2014 18:11:54 +0000 (19:11 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 19 Feb 2014 18:11:54 +0000 (19:11 +0100)
PR c++/60267
* pt.c (tsubst_expr): Handle ANNOTATE_EXPR.

* g++.dg/ext/ivdep-1.C: New test.

From-SVN: r207914

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/ivdep-1.C [new file with mode: 0644]

index 878ba4a2829ebe1b21185b9411c52875ffbe8a82..9218f2b5c9f618c97ec252d85c431c331a8e31f6 100644 (file)
@@ -1,3 +1,8 @@
+2014-02-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/60267
+       * pt.c (tsubst_expr): Handle ANNOTATE_EXPR.
+
 2014-02-18  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/60225
index 7967db8b5b06e38adf12754047116b39e928362e..fb30af35fbf828d75817b667fd423c94459253d5 100644 (file)
@@ -13806,6 +13806,11 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl,
                                    RECUR (TREE_OPERAND (t, 1)),
                                    complain));
 
+    case ANNOTATE_EXPR:
+      tmp = RECUR (TREE_OPERAND (t, 0));
+      RETURN (build2_loc (EXPR_LOCATION (t), ANNOTATE_EXPR,
+                         TREE_TYPE (tmp), tmp, RECUR (TREE_OPERAND (t, 1))));
+
     default:
       gcc_assert (!STATEMENT_CODE_P (TREE_CODE (t)));
 
index 52f2fa8f678ff55c2e7f2331af00e7467cccd660..6396b37c32880a9cf3533ce97069e6b901bf742c 100644 (file)
@@ -1,5 +1,8 @@
 2014-02-19  Jakub Jelinek  <jakub@redhat.com>
 
+       PR c++/60267
+       * g++.dg/ext/ivdep-1.C: New test.
+
        PR c++/60267
        * gcc.dg/pr60267.c: New test.
 
diff --git a/gcc/testsuite/g++.dg/ext/ivdep-1.C b/gcc/testsuite/g++.dg/ext/ivdep-1.C
new file mode 100644 (file)
index 0000000..751154d
--- /dev/null
@@ -0,0 +1,18 @@
+// PR c++/60267
+// { dg-do compile }
+// { dg-options "-O3" }
+
+template <int N>
+void
+foo (int *a, int *b, int *c)
+{
+#pragma GCC ivdep
+  for (int i = 0; i < N; i++)
+    a[i] = b[i] * c[i];
+}
+
+void
+bar (int *a, int *b, int *c)
+{
+  foo <64> (a, b, c);
+}