This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug bootstrap/11315] New: bootstrap error with math.h after fixes 5200-01


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: bootstrap error with math.h after fixes 5200-01
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: bootstrap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kminola at eng dot umd dot edu
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-ibm-aix5.2.0.0
  GCC host triplet: powerpc-ibm-aix5.2.0.0
GCC target triplet: powerpc-ibm-aix5.2.0.0

After install of AIX 5.2 maintenance fixes (5200-01), gcc-3.3 no longer
bootstraps.  (gcc-3.3 did bootstrap on AIX 5.2 before fixes installed.)

Bootstrap error is 

stage1/xgcc -Bstage1/ -B/usr/local/powerpc-ibm-aix5.2.0.0/bin/ -c   -g -O2
-DIN_GC
C   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-Wtraditiona
l -pedantic -Wno-long-long   -DHAVE_CONFIG_H -DGENERATOR_FILE    -I. -I.
-I../../g
cc-3.3/gcc -I../../gcc-3.3/gcc/. -I../../gcc-3.3/gcc/config
-I../../gcc-3.3/gcc/..
/include ../../gcc-3.3/gcc/genautomata.c -o genautomata.o
In file included from ../../gcc-3.3/gcc/genautomata.c:109:
include/math.h:1071:2: '#' is not followed by a macro parameter
In file included from ../../gcc-3.3/gcc/genautomata.c:109:
include/math.h:1072: error: parse error before '==' token
include/math.h:1072: error: syntax error at '#' token
include/math.h:1074: error: syntax error at '#' token
include/math.h:1076: error: syntax error at '#' token
make[2]: *** [genautomata.o] Error 1

Error is caused by changes in macro fpclassify() in math.h
that fixincludes now no longer handles correctly.

Previously fpclassify() in math.h was defined to be

----------------------------------------------------
#ifndef _LONGDOUBLE128
#define fpclassify(__x) \
        ((sizeof(__x) == sizeof(float))  ?  _classf((double) __x) : _class(__x))

[... irrelevant stuff deleted ...]

#else
#define fpclassify(__x) \
        ((sizeof(__x) == sizeof(float))  ?  _classf(__x) : \
         (sizeof(__x) == sizeof(double)) ?  _class(__x) : \
                                       ?  _classl128(__x))
---------------------------------------------------------------

Now fpclassify() is 

---------------------------------------------------------------
#ifndef __LONGDOUBLE128
#define fpclassify(__x) \
    (sizeof(__x) == sizeof(float) ?  \
        ((_classf((double)__x) == FP_SNAN) || (_classf((double)__x) == FP_QNAN)
? \
            FP_QNAN : \
            (_classf((double) __x) & 0x00000001 ? \
                _classf((double) __x) - 1 : \
                _classf((double) __x)) ) : \
        ((class(__x) == FP_SNAN) || (class(__x) == FP_QNAN) ? \
            FP_QNAN : \
            (class(__x)  & 0x00000001 ? \
                _class(__x) - 1 : \
                _class(__x))))

[...irrelevant stuff deleted ...]

#else
#define fpclassify(__x) \
 (sizeof(__x) == sizeof(float) ?  \
        ((_classf((double)__x) == FP_SNAN) || (_classf((double)__x) == FP_QNAN)
? \
            FP_QNAN : \
            (_classf((double) __x) & 0x00000001 ? \
                _classf((double) __x) - 1 : \
                _classf((double) __x)))  :\
    (sizeof(__x) == sizeof(double) ? \
        ((class(__x) == FP_SNAN) || (class(__x) == FP_QNAN) ? \
            FP_QNAN : \
            (class(__x)  & 0x00000001 ? \
                _class(__x) - 1 : \
                _class(__x))) :\
    ((_classl128(__x) == FP_SNAN) || (_classl128(__x) == FP_QNAN) ? \
            FP_QNAN: \
            (_classl128(__x) & 0x00000001 ? \
                _classl128(__x) - 1 : \
                _classl128(__x)))))
----------------------------------------------------------------------

The bootstrap error is caused by the fact that fixincludes surrounds
the four occurrances of "class" with 

#ifndef __cplusplus
#endif

For example:

#define fpclassify(__x) \
    (sizeof(__x) == sizeof(float) ?  \
        ((_classf((double)__x) == FP_SNAN) || (_classf((double)__x) == FP_QNAN)
? 
\
            FP_QNAN : \
            (_classf((double) __x) & 0x00000001 ? \
                _classf((double) __x) - 1 : \
                _classf((double) __x)) ) : \
#ifndef __cplusplus
        ((class(__x) == FP_SNAN) || (class(__x) == FP_QNAN) ? \
#endif
            FP_QNAN : \
#ifndef __cplusplus
            (class(__x)  & 0x00000001 ? \
#endif
                _class(__x) - 1 : \
                _class(__x))))

Possible fix - if each of the occurances of "class" is changed to 
"_class", gcc-3.3 will bootstrap.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]