From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57799 invoked by alias); 13 Nov 2015 10:03:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 57787 invoked by uid 89); 13 Nov 2015 10:02:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f180.google.com Received: from mail-ob0-f180.google.com (HELO mail-ob0-f180.google.com) (209.85.214.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 13 Nov 2015 10:02:57 +0000 Received: by obdgf3 with SMTP id gf3so70215252obd.3 for ; Fri, 13 Nov 2015 02:02:55 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.182.114.167 with SMTP id jh7mr12201389obb.70.1447408975672; Fri, 13 Nov 2015 02:02:55 -0800 (PST) Received: by 10.60.138.6 with HTTP; Fri, 13 Nov 2015 02:02:55 -0800 (PST) Date: Fri, 13 Nov 2015 10:03:00 -0000 Message-ID: Subject: Re: [PATCH 1/2] simplify-rtx: Simplify trunc of and of shiftrt From: Uros Bizjak To: "gcc-patches@gcc.gnu.org" Cc: Segher Boessenkool Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-11/txt/msg01635.txt.bz2 Hello! > 2015-11-09 Segher Boessenkool > > * gcc/simplify-rtx.c (simplify_truncation): Simplify TRUNCATE > of AND of [LA]SHIFTRT. Revision r230164 (the above patch) regressed: FAIL: gcc.target/alpha/pr42269-1.c scan-assembler-not addl on alpha-linux-gnu. The difference starts in combine, where before the patch, we were able to combine insns: (insn 7 6 8 2 (set (reg:DI 82) (lshiftrt:DI (reg:DI 81 [ x ]) (const_int 16 [0x10]))) pr42269-1.c:8 66 {lshrdi3} (expr_list:REG_DEAD (reg:DI 81 [ x ]) (nil))) (insn 8 7 11 2 (set (reg:DI 70 [ _2 ]) (sign_extend:DI (subreg:SI (reg:DI 82) 0))) pr42269-1.c:8 2 {*extendsidi2_1} (expr_list:REG_DEAD (reg:DI 82) (nil))) to: Trying 7 -> 8: Successfully matched this instruction: (set (reg:DI 70 [ _2 ]) (zero_extract:DI (reg/v:DI 80 [ x ]) (const_int 16 [0x10]) (const_int 16 [0x10]))) allowing combination of insns 7 and 8 original costs 4 + 4 = 8 replacement cost 4 deferring deletion of insn with uid = 7. modifying insn i3 8: r70:DI=zero_extract(r80:DI,0x10,0x10) deferring rescan insn with uid = 8. After the patch, the combination fails: Trying 7 -> 8: Failed to match this instruction: (set (reg:DI 70 [ _2 ]) (sign_extend:DI (lshiftrt:SI (subreg:SI (reg/v:DI 80 [ x ]) 0) (const_int 16 [0x10])))) Uros.