re PR target/58944 (bogus -Wunused-macros warnings when compiling Libreoffice)

PR target/58944
	* config/i386/i386-c.c (ix86_pragma_target_parse): Temporarily
	clear cpp_get_options (parse_in)->warn_unused_macros for
	ix86_target_macros_internal with cpp_define.

	* gcc.target/i386/pr58944.c: Drop -march=native from dg-options.
	Remove dg-prune-output lines.

From-SVN: r206750
This commit is contained in:
Jakub Jelinek 2014-01-18 11:18:33 +01:00 committed by Jakub Jelinek
parent 04da56800d
commit fa5d6c752e
4 changed files with 23 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2014-01-18 Jakub Jelinek <jakub@redhat.com>
PR target/58944
* config/i386/i386-c.c (ix86_pragma_target_parse): Temporarily
clear cpp_get_options (parse_in)->warn_unused_macros for
ix86_target_macros_internal with cpp_define.
2014-01-18 Richard Sandiford <rdsandiford@googlemail.com>
* jump.c (delete_related_insns): Keep (use (insn))s.

View File

@ -460,6 +460,13 @@ ix86_pragma_target_parse (tree args, tree pop_target)
(enum fpmath_unit) prev_opt->x_ix86_fpmath,
cpp_undef);
/* For the definitions, ensure all newly defined macros are considered
as used for -Wunused-macros. There is no point warning about the
compiler predefined macros. */
cpp_options *cpp_opts = cpp_get_options (parse_in);
unsigned char saved_warn_unused_macros = cpp_opts->warn_unused_macros;
cpp_opts->warn_unused_macros = 0;
/* Define all of the macros for new options that were just turned on. */
ix86_target_macros_internal (cur_isa & diff_isa,
cur_arch,
@ -467,6 +474,8 @@ ix86_pragma_target_parse (tree args, tree pop_target)
(enum fpmath_unit) cur_opt->x_ix86_fpmath,
cpp_define);
cpp_opts->warn_unused_macros = saved_warn_unused_macros;
return true;
}

View File

@ -1,3 +1,9 @@
2014-01-18 Jakub Jelinek <jakub@redhat.com>
PR target/58944
* gcc.target/i386/pr58944.c: Drop -march=native from dg-options.
Remove dg-prune-output lines.
2014-01-17 Jakub Jelinek <jakub@redhat.com>
PR middle-end/59706

View File

@ -1,11 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-Wunused-macros -march=native" } */
/* { dg-options "-Wunused-macros" } */
#pragma GCC push_options
#pragma GCC target("xsaveopt")
void fn1(void) {}
#pragma GCC pop_options
/* { dg-prune-output "macro \"__code_model_" } */
/* { dg-prune-output "macro \"__XSAVE__\" is not used" } */
/* { dg-prune-output "macro \"__XSAVEOPT__\" is not used" } */