From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DAC653858CDB; Mon, 3 Apr 2023 00:01:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DAC653858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680480084; bh=w8t8Vy5gujsWPGpwPoll1V32I9dCuGxUDYtroNmuDaI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iQd/IaqcKATJto+RuLxfHCIXpgXqaFPCHd/ohL9Eko6uakUpmuRGwDF76TxpMBffM K6pyM/PhW8jMJ1BiIcOo5GWGXn++fZoucYj91ML6tHI6qQXMQfQrfcnFc8v2uzvpGl 6ENL8DbcquCOgBbdZ38L1U+oJ3VWjwnUl7OYB2sE= From: "g.peterhoff@t-online.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109378] new builtin like __builtin_sqrt but does not set errno Date: Mon, 03 Apr 2023 00:01:24 +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: unknown X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: g.peterhoff@t-online.de X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED 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: resolution 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=3D109378 g.peterhoff@t-online.de changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |FIXED --- Comment #11 from g.peterhoff@t-online.de --- Ok, in detail: std::sqrt/__builtin_sqrt performs the check for nan in the calling context. This causes the following problems: * the calling context contains error handling/conditional jumps, which have nothing to do there but have to be handled in the error handling of std::sq= rt * Because this does NOT happen in your implementation of std::sqrt, the code gets bloated, at the latest when a function contains more than one std::sqr= t. Therefore * do complete error handling in std::sqrt/__builtin_sqrt * so there is only one exact call for std::sqrt, which can/must be vectoriz= ed.=