From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34496 invoked by alias); 5 Oct 2015 08:43:19 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 34364 invoked by uid 48); 5 Oct 2015 08:43:10 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/67830] [6 Regression] wrong code at -O1 and above on x86_64-linux-gnu Date: Mon, 05 Oct 2015 08:43:00 -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: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: 6.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-10/txt/msg00306.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67830 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW CC| |law at gcc dot gnu.org --- Comment #2 from Richard Biener --- _7 = (int) _5; _10 = (int) d.2_9; f_11 = _10 - _7; _12 = f_11 & -2; with _5 and d.2_9 being of type unsigned char is transformed to _15 = d.2_9 - _5; _16 = _15 & 254; _12 = (int) _16; with _16 being unsigned char. That looks wrong as it changes a sign-extended subtraction result to a zero-extended one. CCing Jeff who added that pattern.