From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5393C3858D34; Mon, 22 Jun 2020 08:05:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5393C3858D34 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592813115; bh=POKP26+MYaDzSUKkZtG8S6+KPl/4dw0pnSJrelwBpaU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vkZybnl6ToIfTJP8fCU2YJgXn45+8BD2hevdVc8nTOekuf6AMwEEyCOQ1OXrQT7FW RfMXIX7C4+SvoPQtnmMZBwM5NpWRhN8uKKazhlYEyXh8o9vdmt6rf6GToI9QU29ISf hS30ids0NZDB2NSno3vhDYwjfBE0eVNAdwc8jSE4= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95784] Failure to optimize usage of __builtin_add_overflow with return statement properly Date: Mon, 22 Jun 2020 08:05:15 +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: 11.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org 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: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2020 08:05:15 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95784 --- Comment #9 from Richard Biener --- I wouldn't be surprised if a version with a branch is faster even with each of the branches mispredicted. cmovs are weird beasts but since they are not dependent on each other their latency at least shouldn't add up here so LLVMs two cmovs shouldnt be worse off than GCCs one cmov. You'd need to compare against a variant without any cmov.=