From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5E5733858C50; Sat, 14 Oct 2023 14:47:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E5733858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697294870; bh=KF6ngt+SVgiEgVb1XzDa69WrKv7komVwxrrsHl89Fr4=; h=From:To:Subject:Date:From; b=jis4m09E4o1y0fWiesuIipp2ztwZiLiqnL9uMvHutO0VQqXs+ba1naHRAKsNJIJps WxpTIaSn879lMNvYmpkAhmKtiw6ivAp/CSxZCDGJjxWcnNEcEqYpOrofacXLm1OBXu I/lwL2qPDlp0FZ0qBPNEzSVF42wPVI+OHV6AVTDY= From: "muecker at gwdg dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/111808] New: [C23] constexpr Date: Sat, 14 Oct 2023 14:47:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: muecker at gwdg dot de X-Bugzilla-Status: UNCONFIRMED 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_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D111808 Bug ID: 111808 Summary: [C23] constexpr Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: muecker at gwdg dot de Target Milestone: --- GCC implements constraint 6.7.1p5 for constexpr initialized with a float pointer value as an error. For example, the following fails to compile on i386: int func(void)=20 { constexpr double f2 =3D 1. / 3.; return 3. * f2 =3D=3D 3. * (1. / 3.); } with : In function 'func': :7:25: error: 'constexpr' initializer not representable in type of object 7 | constexpr double f2 =3D 1. / 3.; while it compiles on x64-86. This seems problematic because this it will c= ause a lot surprising failures when compiling code written for x64-86 on i386. = We should either have a warning that such code is non-portable (but this seems difficult) or downgrade this to a warning and accept the code as an extensi= on on architectures which compute with excess precision. https://godbolt.org/z/7vsWhvKjd=