PR c++/60267
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Feb 2014 16:45:21 +0000 (16:45 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Feb 2014 16:45:21 +0000 (16:45 +0000)
* c-pragma.c (init_pragma): Don't call cpp_register_deferred_pragma
for PRAGMA_IVDEP if flag_preprocess_only.

* gcc.dg/pr60267.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207911 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/c-family/ChangeLog
gcc/c-family/c-pragma.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr60267.c [new file with mode: 0644]

index 78310d2..972be93 100644 (file)
@@ -1,3 +1,9 @@
+2014-02-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/60267
+       * c-pragma.c (init_pragma): Don't call cpp_register_deferred_pragma
+       for PRAGMA_IVDEP if flag_preprocess_only.
+
 2014-02-12  Jakub Jelinek  <jakub@redhat.com>
 
        PR c/60101
index 07d23ac..91fffdb 100644 (file)
@@ -1392,8 +1392,9 @@ init_pragma (void)
     cpp_register_deferred_pragma (parse_in, "GCC", "pch_preprocess",
                                  PRAGMA_GCC_PCH_PREPROCESS, false, false);
 
-  cpp_register_deferred_pragma (parse_in, "GCC", "ivdep", PRAGMA_IVDEP, false,
-                               false);
+  if (!flag_preprocess_only)
+    cpp_register_deferred_pragma (parse_in, "GCC", "ivdep", PRAGMA_IVDEP, false,
+                                 false);
 #ifdef HANDLE_PRAGMA_PACK_WITH_EXPANSION
   c_register_pragma_with_expansion (0, "pack", handle_pragma_pack);
 #else
index 3cf924b..52f2fa8 100644 (file)
@@ -1,3 +1,8 @@
+2014-02-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/60267
+       * gcc.dg/pr60267.c: New test.
+
 2014-02-19  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/59794
diff --git a/gcc/testsuite/gcc.dg/pr60267.c b/gcc/testsuite/gcc.dg/pr60267.c
new file mode 100644 (file)
index 0000000..b6228fc
--- /dev/null
@@ -0,0 +1,14 @@
+/* PR c++/60267 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -save-temps" } */
+
+void
+foo (int *a, int *b, int *c)
+{
+  int i;
+#pragma GCC ivdep
+  for (i = 0; i < 64; i++)
+    a[i] = b[i] * c[i];
+}
+
+/* { dg-final { cleanup-saved-temps } } */