From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6637 invoked by alias); 6 May 2011 21:49:44 -0000 Received: (qmail 6629 invoked by uid 22791); 6 May 2011 21:49:43 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 May 2011 21:49:29 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id AA0A5CB0278; Fri, 6 May 2011 23:49:28 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5DvvcVn8eSwS; Fri, 6 May 2011 23:49:25 +0200 (CEST) Received: from [192.168.1.3] (bon31-9-83-155-120-49.fbx.proxad.net [83.155.120.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 88579CB01F7; Fri, 6 May 2011 23:49:25 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Cleanup expand_shift Date: Fri, 06 May 2011 21:52:00 -0000 User-Agent: KMail/1.9.9 Cc: Richard Guenther , "Hans-Peter Nilsson" References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201105062349.19480.ebotcazou@adacore.com> 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 X-SW-Source: 2011-05/txt/msg00557.txt.bz2 > I'm going to bootstrap & regtest this on x86_64-unknown-linux-gnu > (with again zero testing coverage ...). The patch fixes the > reported ICE with a cross to cris-elf, more testing is appreciated > (though I guess autotesters will pick it up). > > Does it look sane? Yes, I think so, but... > Index: gcc/expmed.c > =================================================================== > *** gcc/expmed.c (revision 173473) > --- gcc/expmed.c (working copy) > *************** expand_shift_1 (enum tree_code code, enu > *** 2141,2151 **** > rtx new_amount, other_amount; > rtx temp1; > > new_amount = op1; > ! other_amount > ! = simplify_gen_binary (MINUS, GET_MODE (op1), > ! GEN_INT (GET_MODE_BITSIZE (mode)), > ! op1); > > shifted = force_reg (mode, shifted); > > --- 2141,2156 ---- > rtx new_amount, other_amount; > rtx temp1; > > + op1_mode = GET_MODE (op1); > new_amount = op1; > ! if (op1_mode == VOIDmode) > ! other_amount = GEN_INT (GET_MODE_BITSIZE (mode) > ! - INTVAL (op1)); > ! else > ! other_amount > ! = simplify_gen_binary (MINUS, op1_mode, > ! GEN_INT (GET_MODE_BITSIZE (mode)), > ! op1); > > shifted = force_reg (mode, shifted); ... I'd test CONST_INT_P (op1) instead of op1_mode == VOIDmode since you are accessing INTVAL in the branch. -- Eric Botcazou