From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 95E3B385841A; Tue, 8 Mar 2022 18:36:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 95E3B385841A From: "beebe at math dot utah.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/26374] Compile failure on long double Date: Tue, 08 Mar 2022 18:36:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 4.1.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: beebe at math dot utah.edu X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2022 18:36:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D26374 --- Comment #14 from beebe at math dot utah.edu --- >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D26374 That is a really old one, from early 2006; I would have hoped that it had long since been repaired in gcc. However, I just checked my VM for CentOS 7 on PowerPC, and found this: % cat foo.c static const double x =3D 1.0L / 42 ; % /usr/bin/gcc -c foo.c foo.c:1:1: error: initializer element is not computable at load time static const double x =3D 1.0L / 42 ; That is gcc-4.8.5 (20150623 (Red Hat 4.8.5-44)). I recently built gcc-8.5.0 on that system, and it raises the same error. Changing 42 to 42.0L to have a pure long-double expression does not eliminate the error with either compiler. The assignment is perfectly legal in all ISO Standards for C from 1989 to date, and the expression must be evaluated to IEEE 754 requirements by the compiler, producing a correctly rounded result. That latter would not be possible if it were expressed as a fractional value, because the C Standards do not require correct conversion of decimal fractions to binary fractions. The build of gcc-8.5.0 took five days on this qemu-emulated CPU, so it really is not practical for me to try the test file with gcc-9 through gcc-12 versions. I needed 8.5.0 to be able to build TeX Live 2022: see http://www.math.utah.edu/pub/texlive-utah/#centos-7-ppc64be for my report (and many others elsewhere in that Web page). ---------------------------------------------------------------------------= ---- - Nelson H. F. Beebe Tel: +1 801 581 5254 = - - University of Utah FAX: +1 801 581 4148 = - - Department of Mathematics, 110 LCB Internet e-mail: beebe@math.utah.ed= u - - 155 S 1400 E RM 233 beebe@acm.org beebe@computer.o= rg - - Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beeb= e/ - ---------------------------------------------------------------------------= ----=