From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 48CDE3857C47; Mon, 17 Aug 2020 08:14:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 48CDE3857C47 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597652074; bh=Rqwo0JarSS86mE+ghgg4ZNDKIhlZ4sclVODU0JqzST4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZW6zu6YKEw7a9txRzGnEpv+sWm3NoYaP8yRH4gKDPOq32DAmGTrphFYv0RAhBqBII XTl4mruttZsFpkRosFbvEwgPwQE6VhjKLqHhZ5MoDAHSsnGq7xaz86Rm+nNm7ypPLb DNYUDi/+qoZeAPcK5W8+18A7BLvT6Wx6ixRZwtFQ= From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/96633] missed optimization? Date: Mon, 17 Aug 2020 08:14:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin 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: cf_reconfirmed_on bug_status keywords cc everconfirmed 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, 17 Aug 2020 08:14:34 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96633 Martin Li=C5=A1ka changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2020-08-17 Status|UNCONFIRMED |NEW Keywords| |missed-optimization CC| |marxin at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Martin Li=C5=A1ka --- Nice trick! Generally speaking about the optimization (for longer types), it can be tri= cky as: shr $6, %ecx can be bigger than 64 and so shrq %cl, %rax can result in undefined behavior as 1 << X, where X > 64.=