This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix "#pragma GCC pop_options" warning.
- From: Bernd Schmidt <bschmidt at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>, Stefan Liebler <STLI at de dot ibm dot com>
- Date: Tue, 13 Oct 2015 14:28:37 +0200
- Subject: Re: [PATCH] Fix "#pragma GCC pop_options" warning.
- Authentication-results: sourceware.org; auth=none
- References: <20151013120203 dot GA21522 at linux dot vnet dot ibm dot com>
On 10/13/2015 02:02 PM, Dominik Vogt wrote:
When "#pragma GCC pop_options" is used on a platform without
support for "#pragma GCC target", Gcc emits a warning. As
pop_options is useful on targets without the target pragma to
restore optimizations flags, the warning should be removed.
The attached patch does that rather inelegantly by checking if the
pragma_parse hook points to the default implementation. I could't
think of a similarly terse but less clumsy way. Suggestions for a
better test are very welcome.
gcc/ChangeLog:
* c-pragma.c: Include targhooks.h.
(handle_pragma_pop_options): Do not call
default_target_option_pragma_parse to prevent its warning when using
"#pragma GCC pop_options" on platforms that do not support
"#pragma GCC target".
Why not just remove the code that emits the warning message? Are there
situations where the warning is justified?
A testcase would be good.
Bernd