From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20538 invoked by alias); 30 Jun 2010 11:52:09 -0000 Received: (qmail 20476 invoked by uid 48); 30 Jun 2010 11:51:54 -0000 Date: Wed, 30 Jun 2010 11:52:00 -0000 Message-ID: <20100630115154.20475.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug rtl-optimization/44695] [4.6 Regression] ice in simplify_subreg, at simplify-rtx.c:5117 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "bonzini at gnu dot org" 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 X-SW-Source: 2010-06/txt/msg02922.txt.bz2 ------- Comment #5 from bonzini at gnu dot org 2010-06-30 11:51 ------- I agree that the problem is a wrong pattern. Here you have non-matching mode between the udiv/umod and the first argument: > (ior:HI (ashift:HI (zero_extend:HI (umod:QI (reg:HI 68) > (reg:QI 61 [ D.2750 ]))) > (const_int 8 [0x8])) > (zero_extend:HI (udiv:QI (reg:HI 68) > (reg:QI 61 [ D.2750 ])))) Instead you need to have this before reload: (set (match_operand:HI "register_operand" "=a") (ior:HI (ashift:HI (zero_extend:HI (umod:QI (match_operand:QI "register_operand" "0") (match_operand:QI "register_operand" "q"))) (const_int 8 [0x8])) (zero_extend:HI (udiv:QI (match_dup 1) (match_dup 2)))) and after reload split it into a zero/sign extension of al into ax followed by (set (match_dup 0) (ior:HI (ashift:HI (umod:HI (match_dup 0) (zero_extend:HI (match_dup 2))) (const_int 8 [0x8])) (udiv:HI (match_dup 0) (zero_extend:HI (match_dup 2)))) (or maybe sign extend into eax? QImode->SImode is definitely cheaper for zero extension, I don't know about the cost of cbw because of partial register stalls). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44695