From 4bb0068875e005b2f0e33bec0bd5a70b798af6e3 Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@linux.vnet.ibm.com>
Date: Tue, 13 Oct 2015 15:54:15 +0100
Subject: [PATCH] Remove "#pragma GCC pop_options" warning for "#pragma GCC
pop_options".
---
gcc/targhooks.c | 8 ++++++--
gcc/testsuite/gcc.dg/pragma-pop_options-1.c | 7 +++++++
2 files changed, 13 insertions(+), 2 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/pragma-pop_options-1.c
@@ -1305,8 +1305,12 @@ bool
default_target_option_pragma_parse (tree ARG_UNUSED (args),
tree ARG_UNUSED (pop_target))
{
- warning (OPT_Wpragmas,
- "#pragma GCC target is not supported for this machine");
+ /* If args is NULL the caller is handle_pragma_pop_options (). In that case,
+ emit no warning because "#pragma GCC pop_target" is valid on targets that
+ do not have the "target" pragma. */
+ if (args)
+ warning (OPT_Wpragmas,
+ "#pragma GCC target is not supported for this machine");
return false;
}
new file mode 100644
@@ -0,0 +1,7 @@
+/* Check warnings produced by #pragma GCC push/pop/reset_options. */
+/* { dg-do assemble } */
+
+#pragma push_options
+#pragma pop_options
+
+int foo;
--
2.3.0