From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16710 invoked by alias); 30 Jun 2014 01:59:53 -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 16513 invoked by uid 55); 30 Jun 2014 01:59:37 -0000 From: "thopre01 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/61306] [4.10 Regression] wrong code at -Os and above on x86_64-linux-gnu Date: Mon, 30 Jun 2014 01:59: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: 4.10.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: thopre01 at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: thopre01 at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.10.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: 2014-06/txt/msg02371.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61306 --- Comment #8 from thopre01 at gcc dot gnu.org --- Author: thopre01 Date: Mon Jun 30 01:58:45 2014 New Revision: 212133 URL: https://gcc.gnu.org/viewcvs?rev=212133&root=gcc&view=rev Log: 2014-06-30 Thomas Preud'homme Backport from mainline 2014-06-20 Jakub Jelinek 2014-06-11 Thomas Preud'homme gcc/ PR tree-optimization/61306 * tree-ssa-math-opts.c (struct symbolic_number): Store type of expression instead of its size. (do_shift_rotate): Adapt to change in struct symbolic_number. Return false to prevent optimization when the result is unpredictable due to arithmetic right shift of signed type with highest byte is set. (verify_symbolic_number_p): Adapt to change in struct symbolic_number. (find_bswap_1): Likewise. Return NULL to prevent optimization when the result is unpredictable due to sign extension. (find_bswap): Adapt to change in struct symbolic_number. gcc/testsuite/ * gcc.c-torture/execute/pr61306-1.c: New test. * gcc.c-torture/execute/pr61306-2.c: Likewise. * gcc.c-torture/execute/pr61306-3.c: Likewise. Added: branches/gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/pr61306-1.c branches/gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/pr61306-2.c branches/gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/pr61306-3.c Modified: branches/gcc-4_9-branch/gcc/ChangeLog branches/gcc-4_9-branch/gcc/testsuite/ChangeLog branches/gcc-4_9-branch/gcc/tree-ssa-math-opts.c