This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix "#pragma GCC pop_options" warning.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]