https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87299

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-09-15
                 CC|                            |manu at gcc dot gnu.org
          Component|preprocessor                |middle-end
            Summary|use of -save-temps causes   |#pragma GCC target behaves
                   |undue macro re-definition   |differently when using
                   |warning                     |-save-temps
     Ever confirmed|0                           |1

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
test.c:4:0: warning: "x" redefined
 # define x z
 ^
test.c:1:0: note: this is the location of the previous definition
 #define x y
 ^

The mirror testcase:

#pragma GCC target("avx512f")
#define x y
# define __AVX512F__ z
#ifndef __AVX512F__
#define x z
#endif

$ gcc -c  test.c
test.c:3:0: warning: "__AVX512F__" redefined
 # define __AVX512F__ z
 ^
test.c:2:0: note: this is the location of the previous definition
 #define x y
 ^
$ gcc -c  --save-temps test.c


So #pragma GCC target does not seem to create the macro when --save-temps is
used.

Reply via email to