public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/58944] New: [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice
@ 2013-10-31 18:24 octoploid at yandex dot com
  2013-10-31 19:06 ` [Bug other/58944] " octoploid at yandex dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: octoploid at yandex dot com @ 2013-10-31 18:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58944

            Bug ID: 58944
           Summary: [4.9 Regression] bogus -Wunused-macros warnings when
                    compiling Libreoffice
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: octoploid at yandex dot com

markus@x4 tmp % cat test.ii
#pragma GCC push_options
#pragma GCC target("xsaveopt")
void fn1(void) {}
#pragma GCC pop_options

markus@x4 tmp % gcc -Wunused-macros -march=native -c test.ii
test.ii:4:9: warning: macro "__code_model_small__" is not used
[-Wunused-macros]
 #pragma GCC pop_options
         ^
test.ii:4:9: warning: macro "__XSAVE__" is not used [-Wunused-macros]
test.ii:4:9: warning: macro "__XSAVEOPT__" is not used [-Wunused-macros]
test.ii:4:24: warning: macro "__amdfam10__" is not used [-Wunused-macros]
 #pragma GCC pop_options
                        ^
test.ii:4:24: warning: macro "__amdfam10" is not used [-Wunused-macros]
test.ii:4:24: warning: macro "__code_model_small__" is not used
[-Wunused-macros]
test.ii:4:24: warning: macro "__tune_amdfam10__" is not used [-Wunused-macros]
markus@x4 tmp %  

The "__tune_amdfam10__" and "__amdfam10" (and maybe "__code_model_small__")
warnings look bogus. 
I've noticed this issue while compiling Libreoffice.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug other/58944] [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice
  2013-10-31 18:24 [Bug other/58944] New: [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice octoploid at yandex dot com
@ 2013-10-31 19:06 ` octoploid at yandex dot com
  2013-11-04 20:25 ` tmsriram at google dot com
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: octoploid at yandex dot com @ 2013-10-31 19:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58944

octoploid at yandex dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tmsriram at gcc dot gnu.org

--- Comment #1 from octoploid at yandex dot com ---
Started with r203634.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug other/58944] [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice
  2013-10-31 18:24 [Bug other/58944] New: [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice octoploid at yandex dot com
  2013-10-31 19:06 ` [Bug other/58944] " octoploid at yandex dot com
@ 2013-11-04 20:25 ` tmsriram at google dot com
  2013-11-06  1:18 ` tmsriram at google dot com
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tmsriram at google dot com @ 2013-11-04 20:25 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58944

Sriraman Tallam <tmsriram at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tmsriram at google dot com

--- Comment #3 from Sriraman Tallam <tmsriram at google dot com> ---
(In reply to octoploid from comment #1)
> Started with r203634.

I am able to reproduce the problem though I get the bogus warning:

test.cc:4:24: warning: macro "__corei7__" is not used [-Wunused-macros]

I am triaging.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug other/58944] [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice
  2013-10-31 18:24 [Bug other/58944] New: [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice octoploid at yandex dot com
  2013-10-31 19:06 ` [Bug other/58944] " octoploid at yandex dot com
  2013-11-04 20:25 ` tmsriram at google dot com
@ 2013-11-06  1:18 ` tmsriram at google dot com
  2013-11-19 10:42 ` [Bug target/58944] " rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tmsriram at google dot com @ 2013-11-06  1:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58944

Sriraman Tallam <tmsriram at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |davidxl at google dot com

--- Comment #4 from Sriraman Tallam <tmsriram at google dot com> ---
This patch seems to solve the problem

Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c    (revision 204298)
+++ config/i386/i386.c    (working copy)
@@ -4634,6 +4634,8 @@
      be set.  */
   cl_target_option_restore (&func_options,
                 TREE_TARGET_OPTION (target_option_default_node));
+  func_options.x_ix86_arch_string = ix86_arch_string;
+  func_options.x_ix86_tune_string = ix86_tune_string;

   new_target = ix86_valid_target_attribute_tree (args, &func_options,
                          &global_options_set);


cl_target_option_restore does not touch ix86_arch_string and ix86_tune_string.
This has to be managed explicitly. I am testing this patch now.

Thanks,
Sri


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/58944] [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice
  2013-10-31 18:24 [Bug other/58944] New: [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice octoploid at yandex dot com
                   ` (2 preceding siblings ...)
  2013-11-06  1:18 ` tmsriram at google dot com
@ 2013-11-19 10:42 ` rguenth at gcc dot gnu.org
  2013-11-19 17:39 ` tmsriram at google dot com
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-11-19 10:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58944

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-*-*, i?86-*-*
           Priority|P3                          |P1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-11-19
          Component|other                       |target
            Version|unknown                     |4.9.0
     Ever confirmed|0                           |1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/58944] [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice
  2013-10-31 18:24 [Bug other/58944] New: [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice octoploid at yandex dot com
                   ` (3 preceding siblings ...)
  2013-11-19 10:42 ` [Bug target/58944] " rguenth at gcc dot gnu.org
@ 2013-11-19 17:39 ` tmsriram at google dot com
  2013-12-03  3:14 ` tmsriram at gcc dot gnu.org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tmsriram at google dot com @ 2013-11-19 17:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58944

Sriraman Tallam <tmsriram at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bernd.edlinger at hotmail dot de

--- Comment #5 from Sriraman Tallam <tmsriram at google dot com> ---
This also seems similar to the -mpreferred-stack-boundary issue that Bernd
reported recently. Cut and paste from that email:


############################
Currently on trunk the option -mpreferred-stack-boundary does not work
together with #pragma GCC target("sse") or __attribute__((target("sse"))).

There is already a test case that detects this:
gcc.target/i386/fastcall-sseregparm.c


Index: gcc/config/i386/i386.c
===================================================================
--- gcc/config/i386/i386.c    (revision 204101)
+++ gcc/config/i386/i386.c    (working copy)
@@ -4626,6 +4626,9 @@ ix86_valid_target_attribute_p (tree fndecl,
   memset (&func_options, 0, sizeof (func_options));
   init_options_struct (&func_options, NULL);
   lang_hooks.init_options_struct (&func_options);
+  if (global_options_set.x_ix86_preferred_stack_boundary_arg)
+    func_options.x_ix86_preferred_stack_boundary_arg
+      = global_options.x_ix86_preferred_stack_boundary_arg;

   cl_optimization_restore (&func_options,
   TREE_OPTIMIZATION (func_optimize));

####################


I will fix these generically by adding more fields to cl_target_option and
restoring from there.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/58944] [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice
  2013-10-31 18:24 [Bug other/58944] New: [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice octoploid at yandex dot com
                   ` (4 preceding siblings ...)
  2013-11-19 17:39 ` tmsriram at google dot com
@ 2013-12-03  3:14 ` tmsriram at gcc dot gnu.org
  2013-12-03  3:17 ` tmsriram at google dot com
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tmsriram at gcc dot gnu.org @ 2013-12-03  3:14 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58944

--- Comment #6 from tmsriram at gcc dot gnu.org <tmsriram at gcc dot gnu.org> ---
Author: tmsriram
Date: Tue Dec  3 03:14:09 2013
New Revision: 205616

URL: http://gcc.gnu.org/viewcvs?rev=205616&root=gcc&view=rev
Log:
This patch fixes PR 58944
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58944

ix86_valid_target_attribute_tree in config/i386/i386.c was
refactored to not depend on global_options structure and to be able to
use any gcc_options structure.  One clean way to fix this is by having
target_option_default_node save all the default target options which
can be restored to any gcc_options structure. The root cause of the
above bugs was that ix86_arch_string and ix86_tune_string was not
saved in target_option_deault_node.

This patch saves all the  target options used in i386.opt which are
either obtained from the command-line or set to some default.

Testing:
Patch tested for bootstrap on all default languages(also obj-c++ and ada)
on x86_64 and regression testsuite checked for parity with RUNTESTFLAGS -m32
and m64.


Added:
    trunk/gcc/testsuite/gcc.target/i386/pr58944.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c
    trunk/gcc/config/i386/i386.opt
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/58944] [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice
  2013-10-31 18:24 [Bug other/58944] New: [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice octoploid at yandex dot com
                   ` (5 preceding siblings ...)
  2013-12-03  3:14 ` tmsriram at gcc dot gnu.org
@ 2013-12-03  3:17 ` tmsriram at google dot com
  2013-12-03 13:23 ` octoploid at yandex dot com
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tmsriram at google dot com @ 2013-12-03  3:17 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58944

--- Comment #7 from Sriraman Tallam <tmsriram at google dot com> ---
(In reply to tmsriram@gcc.gnu.org from comment #6)
> Author: tmsriram
> Date: Tue Dec  3 03:14:09 2013
> New Revision: 205616
> 
> URL: http://gcc.gnu.org/viewcvs?rev=205616&root=gcc&view=rev
> Log:
> This patch fixes PR 58944
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58944
> 
> ix86_valid_target_attribute_tree in config/i386/i386.c was
> refactored to not depend on global_options structure and to be able to
> use any gcc_options structure.  One clean way to fix this is by having
> target_option_default_node save all the default target options which
> can be restored to any gcc_options structure. The root cause of the
> above bugs was that ix86_arch_string and ix86_tune_string was not
> saved in target_option_deault_node.
> 
> This patch saves all the  target options used in i386.opt which are
> either obtained from the command-line or set to some default.
> 
> Testing:
> Patch tested for bootstrap on all default languages(also obj-c++ and ada)
> on x86_64 and regression testsuite checked for parity with RUNTESTFLAGS -m32
> and m64.
> 
> 
> Added:
>     trunk/gcc/testsuite/gcc.target/i386/pr58944.c
> Modified:
>     trunk/gcc/ChangeLog
>     trunk/gcc/config/i386/i386.c
>     trunk/gcc/config/i386/i386.opt
>     trunk/gcc/testsuite/ChangeLog

Accidentally deleted ChangeLog entry to commit log and committed the patch.
Here is the ChangeLog:

2013-12-02  Sriraman Tallam  <tmsriram@google.com>

    PR target/58944
    * config/i386/i386.opt (ix86_arch_string): Mark this variable
    for saving in cl_target_option.
    (ix86_tune_string): Ditto.
    (ix86_cmodel): Ditto.
    (ix86_abi): Ditto.
    (ix86_asm_dialect): Ditto.
    (ix86_branch_cost): Ditto.
    (ix86_dump_tunes): Ditto.
    (ix86_force_align_arg_pointer): Ditto.
    (ix86_force_drap): Ditto.
    (ix86_incoming_stack_boundary_arg): Ditto.
    (ix86_pmode): Ditto.
    (ix86_preferred_stack_boundary_arg): Ditto.
    (ix86_recip_name): Ditto.
    (ix86_regparm): Ditto.
    (ix86_section_threshold): Ditto.
    (ix86_sse2avx): Ditto.
    (ix86_stack_protector_guard): Ditto.
    (ix86_stringop_alg): Ditto.
    (ix86_tls_dialect): Ditto.
    (ix86_tune_ctrl_string): Ditto.
    (ix86_tune_memcpy_strategy): Ditto.
    (ix86_tune_memset_strategy): Ditto.
    (ix86_tune_no_default): Ditto.
    (ix86_veclibabi_type): Ditto.
    * config/i386/i386.c 
    (function_specific_save): Save the above variables
    in gcc_options to cl_target_option.
    (function_specific_restore): Do the reverse done in
    function_specific_save.
    (ix86_valid_target_attribute_tree): Change ix86_arch_string
    and ix86_tune_string to use the opts structure.
    (ix86_option_override_internal):Change
    ix86_incoming_stack_boundary_arg to
    opts->x_ix86_incoming_stack_boundary_arg


    PR target/58944
    * testsuite/gcc.target/i386/pr58944.c: New test.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/58944] [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice
  2013-10-31 18:24 [Bug other/58944] New: [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice octoploid at yandex dot com
                   ` (6 preceding siblings ...)
  2013-12-03  3:17 ` tmsriram at google dot com
@ 2013-12-03 13:23 ` octoploid at yandex dot com
  2013-12-13 15:02 ` octoploid at yandex dot com
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: octoploid at yandex dot com @ 2013-12-03 13:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58944

Markus Trippelsdorf <octoploid at yandex dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Markus Trippelsdorf <octoploid at yandex dot com> ---
Fixed. Thanks.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/58944] [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice
  2013-10-31 18:24 [Bug other/58944] New: [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice octoploid at yandex dot com
                   ` (7 preceding siblings ...)
  2013-12-03 13:23 ` octoploid at yandex dot com
@ 2013-12-13 15:02 ` octoploid at yandex dot com
  2014-01-17 13:44 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: octoploid at yandex dot com @ 2013-12-13 15:02 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58944

Markus Trippelsdorf <octoploid at yandex dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #9 from Markus Trippelsdorf <octoploid at yandex dot com> ---
I'm still getting:
...
libreoffice-4.1.3.2/canvas/source/factory/cf_service.cxx:528:1: warning: macro
"__code_model_small__" is not used [-Wunused-macros]
 }
 ^


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/58944] [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice
  2013-10-31 18:24 [Bug other/58944] New: [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice octoploid at yandex dot com
                   ` (8 preceding siblings ...)
  2013-12-13 15:02 ` octoploid at yandex dot com
@ 2014-01-17 13:44 ` jakub at gcc dot gnu.org
  2014-01-18 10:19 ` jakub at gcc dot gnu.org
  2014-01-18 10:24 ` jakub at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-01-17 13:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58944

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |ASSIGNED
                 CC|                            |jakub at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 31872
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31872&action=edit
gcc49-pr58944.patch

Untested fix.  It makes no sense to warn about these compiler predefined macros
with -Wunused-macros, the user has no control on what GCC predefines and what
it doesn't.  This patch seems to be the easiest hack for this.  rs6000 will
likely need similar change.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/58944] [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice
  2013-10-31 18:24 [Bug other/58944] New: [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice octoploid at yandex dot com
                   ` (9 preceding siblings ...)
  2014-01-17 13:44 ` jakub at gcc dot gnu.org
@ 2014-01-18 10:19 ` jakub at gcc dot gnu.org
  2014-01-18 10:24 ` jakub at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-01-18 10:19 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58944

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Sat Jan 18 10:18:33 2014
New Revision: 206750

URL: http://gcc.gnu.org/viewcvs?rev=206750&root=gcc&view=rev
Log:
    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.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386-c.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.target/i386/pr58944.c


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/58944] [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice
  2013-10-31 18:24 [Bug other/58944] New: [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice octoploid at yandex dot com
                   ` (10 preceding siblings ...)
  2014-01-18 10:19 ` jakub at gcc dot gnu.org
@ 2014-01-18 10:24 ` jakub at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-01-18 10:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58944

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-01-18 10:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-31 18:24 [Bug other/58944] New: [4.9 Regression] bogus -Wunused-macros warnings when compiling Libreoffice octoploid at yandex dot com
2013-10-31 19:06 ` [Bug other/58944] " octoploid at yandex dot com
2013-11-04 20:25 ` tmsriram at google dot com
2013-11-06  1:18 ` tmsriram at google dot com
2013-11-19 10:42 ` [Bug target/58944] " rguenth at gcc dot gnu.org
2013-11-19 17:39 ` tmsriram at google dot com
2013-12-03  3:14 ` tmsriram at gcc dot gnu.org
2013-12-03  3:17 ` tmsriram at google dot com
2013-12-03 13:23 ` octoploid at yandex dot com
2013-12-13 15:02 ` octoploid at yandex dot com
2014-01-17 13:44 ` jakub at gcc dot gnu.org
2014-01-18 10:19 ` jakub at gcc dot gnu.org
2014-01-18 10:24 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).