From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13047 invoked by alias); 2 Jan 2015 13:38:49 -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 13001 invoked by uid 48); 2 Jan 2015 13:38:44 -0000 From: "vekumar at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/63949] Aarch64 instruction combiner does not optimize subsi_sxth function as expected (gcc.target/aarch64/extend.c fails) Date: Fri, 02 Jan 2015 13:38:00 -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: 5.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: vekumar at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: vekumar 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: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg00039.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63949 --- Comment #7 from vekumar at gcc dot gnu.org --- I ran GCC tests against the patch found one failure. int adds_shift_ext ( long long a, int b, int c) { long long d = (a + ((long long)b << 3)); if (d == 0) return a + c; else return b + d + c; } The test expects adds generation and before my fix it is generated . adds_shift_ext: adds x3, x0, x1, sxtw 3 // 11 *adds_extvdi_multp2 [length = 4] beq .L5 // 12 *condjump [length = 4] But now I am generating sign extends with shifts instead of sign extends with mul in my patch. adds_shift_ext: add x3, x0, x1, sxtw 3 // 10 *add_extendsi_shft_di [length = 4] cbz x3, .L5 // 12 *cbeqdi1 [length = 4] We don't have *adds_extendsi_shft_di pattern. We have patterns for adds_extvdi_multp2 that extends an operation over mult. Adding one will help optimize this case. But my concern is what if other targets hits the same issue?