From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3EAA6385840A; Mon, 24 Oct 2022 20:00:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3EAA6385840A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666641604; bh=/zF4znT18Dz38frHooEaG0CnPvxtsVONCMlMmuhIprw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HgP03/mdGcF9OogO6BDo6Mv+QYafz+MM+NVoei4k3KWjSPnYOFWLBIgErAGH8+nEC coS8BDHbpyThaV4yR80yQHDUnX+jwaJnUEhaI1blRUcVxetiPZ9eIs9tg+Y5BKKqMz tWfF6+WWbmLau++KEvFYx0Mrvn9TksWG3cqB34Cc= From: "joseph at codesourcery dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/107370] long double sqrtl constant folding is wrong Date: Mon, 24 Oct 2022 20:00:02 +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: 10.2.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: joseph at codesourcery dot com 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107370 --- Comment #8 from joseph at codesourcery dot com --- On Mon, 24 Oct 2022, jacob at jacob dot remcomp.fr via Gcc-bugs wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107370 >=20 > --- Comment #3 from jacob navia --- > 1 trunk gcc: > 2 .LC1: > 3 .word 325511829 # 0x1366EA95 <<<--- SHOULD BE 325508205 > 4 .word -922176773 # 0xC908B2FB OK > 5 .word -429395012 # 0xE667F3BC OK > 6 .word 1073703433 # 0x3FFF6A09 OK >=20 > This data is wrong, I repeat, the first number (line 3) should be 3255082= 05 or=20 > 0x1366DC6D. Why do you think that number is wrong? If I compute the square root of=20 2**225 using GMP (so not involving MPFR at all, just integer square root=20 in GMP), I get 1366ea95 as the low 32 bits (and the next bit is a 0, so=20 rounding toward 0 is correct in this case).=