Bug 31321 - gcc fails to compile simple long double initializers
Summary: gcc fails to compile simple long double initializers
Status: RESOLVED DUPLICATE of bug 26374
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-22 23:37 UTC by beebe
Modified: 2007-03-22 23:49 UTC (History)
7 users (show)

See Also:
Host: powerpc-apple-darwin8.9.0
Target: powerpc-apple-darwin8.9.0
Build: powerpc-apple-darwin8.9.0
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description beebe 2007-03-22 23:37:50 UTC
gcc-4.3-20070316 and gcc-4.2-20070307 both fail to compile this
one-line file on Mac OS X 10.4.9 (up to current Apple patch levels):

    % cat foo.c
    static const long double X = (27.0L) / (35.0L);

    % gcc-4.3-20070316 -c foo.c
    foo.c:1: error: initializer element is not constant

If the divisor is changed to 32.0L, it compiles, as does any similar
statement where the right-hand side can be evaluated exactly.

The compilers were built like this:

      nice time env LDFLAGS="-L/usr/local/lib" \
                ../gcc-4.3-20070316/configure \
                        --enable-decimal-float \
                        --enable-languages=c,c++ \
                        --with-gmp=/usr/local \
                        --with-mpfr=/usr/local

        nice time make bootstrap

Similar code with float and double initializers compiles without problems.
Comment 1 Andrew Pinski 2007-03-22 23:49:57 UTC

*** This bug has been marked as a duplicate of 26374 ***