User account creation filtered due to spam.

Bug 26374 - Compile failure on long double
Summary: Compile failure on long double
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.1.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
: 26462 27054 31321 (view as bug list)
Depends on: 19779
Blocks:
  Show dependency treegraph
 
Reported: 2006-02-19 21:59 UTC by Dirk Mueller
Modified: 2014-05-13 18:32 UTC (History)
11 users (show)

See Also:
Host:
Target: powerpc-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-12-26 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Mueller 2006-02-19 21:59:24 UTC
=== Cut ===
static const double  coeff[] = { 1.0l/42 };
=== Cut ===

gives: 

testcase.c:1: error: initializer element is not constant
testcase.c:1: error: (near initialization for ‘coeff[0]’)
Comment 1 Andrew Pinski 2006-02-19 22:01:38 UTC
This is actually because the middle-end does not constant fold 128bit IBM long double.  I am assuming you are using -mlong-double-128.
Comment 2 Andrew Pinski 2006-02-19 22:02:23 UTC
Which is PR 19779.
Comment 3 Richard Biener 2006-02-19 22:03:39 UTC
I'm not sure 1.0l/42 is a valid constant initializer.
Comment 4 Dirk Mueller 2006-02-19 22:04:44 UTC
yes, full configure line: 

Target: powerpc64-suse-linux
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,java --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.1.0 --enable-ssp --disable-libssp --enable-java-awt=gtk --disable-libjava-multilib --with-slibdir=/lib64 --with-system-zlib --enable-shared --enable-__cxa_atexit --enable-libstdcxx-allocator=new --without-system-libunwind --enable-secureplt --with-long-double-128 --host=powerpc64-suse-linux
Comment 5 Dirk Mueller 2006-02-19 22:20:37 UTC
hmm, I guess I'm find with resolving this as duplicate to 19779, even though I don't understand why this is only an issue on PPC for me..

Comment 6 Andrew Pinski 2006-02-19 22:24:49 UTC
(In reply to comment #5)
> hmm, I guess I'm find with resolving this as duplicate to 19779, even though I
> don't understand why this is only an issue on PPC for me..

It is because the long double format used on PPC is IBM's 128bit long double which is two doubles basicially added together.
Comment 7 Andrew Pinski 2006-02-20 19:33:44 UTC
Confirmed.
Comment 8 Andrew Pinski 2006-02-24 21:04:14 UTC
*** Bug 26462 has been marked as a duplicate of this bug. ***
Comment 9 Andrew Pinski 2006-04-06 16:13:56 UTC
*** Bug 27054 has been marked as a duplicate of this bug. ***
Comment 10 David Woodhouse 2006-12-28 14:32:09 UTC
Any progress on this?
Comment 11 Andrew Pinski 2006-12-28 14:48:01 UTC
(In reply to comment #10)
> Any progress on this?
There are two way of fixing this as far as I can see:
teach real.c about how to fold IBM 128bit long double format
use MPFR instead

I would use the latter if I got any time but I don't have any time to do either.
Comment 12 Andrew Pinski 2007-03-22 23:49:57 UTC
*** Bug 31321 has been marked as a duplicate of this bug. ***
Comment 13 Jackie Rosen 2014-02-16 13:12:36 UTC Comment hidden (spam)