From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3E92B3858C53; Sun, 28 May 2023 03:41:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3E92B3858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685245272; bh=5J20FgtRACJmdk8iWFjHx8RhxlN7+WThFGnEIjKRggA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XX0EFsg8FhbAIems7FieuJvtB93L5eUXBM6L6k6tVu9pz96g5qKGJuQ+cckLSS3Cs SWrK8NP+eHfZhEz+1QHVs6y3ajeGrgOVFObfvKOHIrMYkjYBNUGzNqTguxKw9kcQtN jGEcIElVfv+beV2k+nvpmod48gTRRBBaT+0gfaAo= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110011] -mfull-toc (-mfp-in-toc) yields incorrect _Float128 constants on power9 Date: Sun, 28 May 2023 03:41:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 8.3.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org 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: bug_status short_desc everconfirmed cf_reconfirmed_on 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110011 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Summary|-mfull-toc yields incorrect |-mfull-toc (-mfp-in-toc) |_Float128 constants on |yields incorrect _Float128 |power9 |constants on power9 Ever confirmed|0 |1 Last reconfirmed| |2023-05-28 --- Comment #1 from Andrew Pinski --- -mfull-toc does ``` opts->x_rs6000_isa_flags &=3D ~OPTION_MASK_MINIMAL_TOC; opts->x_TARGET_NO_FP_IN_TOC =3D 0; opts->x_TARGET_NO_SUM_IN_TOC =3D 0; opts_set->x_rs6000_isa_flags |=3D OPTION_MASK_MINIMAL_TOC; ``` And then: ``` /* Place FP constants in the constant pool instead of TOC if section anchors enabled. */ if (flag_section_anchors && !OPTION_SET_P (TARGET_NO_FP_IN_TOC)) TARGET_NO_FP_IN_TOC =3D 1; ``` Short testcase which shows the issue at -O2 -mfull-toc (or -O2 -mfp-in-toc): ``` #define MPFR_FLOAT128_MAX 0x1.ffffffffffffffffffffffffffffp+16383f128 _Float128 m1 =3D MPFR_FLOAT128_MAX, n1 =3D -MPFR_FLOAT128_MAX; _Float128 f() { return MPFR_FLOAT128_MAX ; } _Float128 f1() { return -MPFR_FLOAT128_MAX ; } ``` m1 is: ``` m1: .long -1 .long -1 .long -1 .long 2147418111 ``` While the toc version is: ``` .LC0: .quad 0x7ff0000000000000,0x000000000 ``` That is just totally different. (I can't comment on which one is correct but them being different seems wrong).=