From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4493B3858401; Fri, 18 Aug 2023 13:34:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4493B3858401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692365659; bh=fpR7ACBG0PUUsutYZZ+/betp4Rp9RhYbueHK52w61BI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MJnbPLpIcKJgQFGUKrDsc6lItMFczCKjka6Uu8uGsHTFzntV+D6bIJLPppMSvqrHh WIZmNglIEip3LMmKnyHjFhD/X6lBXFX5qdHx6OoMnUaI7bDPA1nO2t2DcKsZqixjqO j7/l7+ZxM1EXYOUVm57Id5TyZxHhv3wymqikh/pc= From: "xry111 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/111058] __builtin_nans (and its friends for other floating-point types) compiles to an external call to __builtin_nans for unsupported tag Date: Fri, 18 Aug 2023 13:34:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: xry111 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: 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=3D111058 --- Comment #6 from Xi Ruoyao --- (In reply to joseph@codesourcery.com from comment #5) > We should absolutely *not* generate calls to a non-existent function=20 > "nans" based on a long-obsolescent standard proposal. The modern way to= =20 > generate a signaling NaN with given payload, as specified in C23, is to=20 > generate a signaling NaN with one of the *_SNAN macros (FLT128_SNAN in=20 > this case) in , then use the relevant setpayload function=20 > (setpayloadf128 in this case) to set its payload. >=20 > I don't think there is any bug here at all. But generating an external call to __builtin_* just does not make sense at = all. If the payload won't be supported, we should just emit a diagnostic and rej= ect the code.=