This is the mail archive of the gcc-patches@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]

[Committed] Fix builtins-1.c on mips-sgi-irix6.5 (and other !TARGET_C99_FUNCTIONS targets)


The following simple patch adds some more sanity checks before we attempt
to canonicalize or transform expressions to use __builtin_cexpi.  Because
BUILT_IN_CEXPI is a GCC built-in (rather than a C99 or library built-in),
it appears to be available (has a non-NULL decl) on all platforms.  Alas
when we attempt to expand __builtin_cexpi later, we assert
TARGET_C99_FUNCTIONs, and thereby ICE on several testsuite test cases on
MIPS/IRIX.

The fix below is to be slightly more cautious and only to transform
expressions to __builtin_cexpi when we can be sure to be able to lower
them to libc/libm functions later.

Tested on both mips-sgi-irix6.5 and i686-pc-linux-gnu, with a full "make
bootstrap", all default langauges, and regression tested with a top-level
"make -k check" with no new failures.

Committed to mainline.


2007-02-05  Roger Sayle  <roger@eyesopen.com>

        * fold-const.c (fold_unary) <REAL_PART>: Test for availability of
        BUILT_IN_COS before simplifying REAL_PART(CEXPI)) to COS.
        <IMAG_PART>: Likewise, check for availability of BUILT_IN_SIN.
        * builtins.c (fold_builtin_sincos): Check for TARGET_C99_FUNCTIONS
        before canonicalizing sincos to cexpi.
        (fold_builtin_cexp): Likewise, for canonicalizing cexp to cexpi.


Roger
--

Attachment: patch.txt
Description: Text document


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