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

            Bug ID: 107638
           Summary: [13 Regression] options.h:239:36: error: token "." is
                    not valid in preprocessor expressions
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: danglin at gcc dot gnu.org
                CC: ppalka at gcc dot gnu.org
  Target Milestone: ---
              Host: hppa64-hp-hpux11.11
            Target: hppa64-hp-hpux11.11
             Build: hppa64-hp-hpux11.11

The following problem was introduced by commit
d0a492faa6478c99d325fa4a7ed2e5633cef7529:

g++ -std=c++11  -fno-PIE -c  -DIN_GCC_FRONTEND -g -DIN_GCC     -fno-exceptions
-
fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-W
cast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H
-I
. -Icp -I../../gcc/gcc -I../../gcc/gcc/cp -I../../gcc/gcc/../include
-I../../gcc
/gcc/../libcpp/include -I../../gcc/gcc/../libcody -I/opt/gnu64/gcc/gmp/include
-I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd
-I../libdecn
umber -I../../gcc/gcc/../libbacktrace -I/opt/gnu64/gcc/gmp/include  -o
cp/tree.o
 -MT cp/tree.o -MMD -MP -MF cp/.deps/tree.TPo ../../gcc/gcc/cp/tree.cc
In file included from ../../gcc/gcc/tree.h:24,
                 from ../../gcc/gcc/cp/tree.cc:24:
./options.h:239:36: error: token "." is not valid in preprocessor expressions
  239 | #define target_flags global_options.x_target_flags
      |                                    ^
./options.h:8725:25: note: in expansion of macro 'target_flags'
 8725 | #define TARGET_GNU_LD ((target_flags & MASK_GNU_LD) != 0)
      |                         ^~~~~~~~~~~~
../../gcc/gcc/config/pa/pa64-hpux.h:358:33: note: in expansion of macro
'TARGET_GNU_LD'
  358 | #define SUPPORTS_INIT_PRIORITY (TARGET_GNU_LD ? 1 : 0)
      |                                 ^~~~~~~~~~~~~
../../gcc/gcc/cp/tree.cc:5039:5: note: in expansion of macro
'SUPPORTS_INIT_PRIORITY'
 5039 | #if SUPPORTS_INIT_PRIORITY
      |     ^~~~~~~~~~~~~~~~~~~~~~
make[3]: *** [Makefile:1135: cp/tree.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/home/dave/gnu/gcc/objdir64/gcc'
make[2]: *** [Makefile:4915: all-stage1-gcc] Error 2
make[2]: Leaving directory '/home/dave/gnu/gcc/objdir64'
make[1]: *** [Makefile:25469: stage1-bubble] Error 2
make[1]: Leaving directory '/home/dave/gnu/gcc/objdir64'
make: *** [Makefile:25822: bootstrap] Error 2
Fri Nov 11 09:17:16 EST 2022

On hppa64-hpux, we have the following define for SUPPORTS_INIT_PRIORITY:

#define SUPPORTS_INIT_PRIORITY (TARGET_GNU_LD ? 1 : 0)

The goal was to support the init_priority attribute with GNU ld and not
with HP ld.

The documentation doesn't indicate whether C statements are allowed
or not for SUPPORTS_INIT_PRIORITY.

Reply via email to