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

           Summary: SUPPORTS_WEAK is documented as a C expression, used as
                    a compile time constant
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: s...@cup.hp.com


The hppa[12]*-hp-hpux11* platforms fail to bootstrap because they are using
SUPPORTS_WEAK as a C expression (as documented) but the GCC code actually
requires that SUPPORTS_WEAK be a constant because it is used in #if statements.

gcc/defaults.h contains:

# if SUPPORTS_WEAK
and
#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK

And looking through the defines during an hppa2.0w-hp-hpux11.11 build I see:

gcc/config/pa/som.h:#define SUPPORTS_WEAK (TARGET_SOM_SDEF && TARGET_GAS)
obj_gcc/gcc/options.h:#define target_flags global_options.x_target_flags
obj_gcc/gcc/options.h:#define MASK_GAS (1 << 4)
obj_gcc/gcc/options.h:#define TARGET_GAS ((target_flags & MASK_GAS) != 0)

This gives a syntax error when SUPPORTS_GCC expands to include
global_options.x_target_flags during compilation.  It used to not give a syntax
error (prior to r164723) but it was probably not working correctly either.

Reply via email to