From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10593 invoked by alias); 6 Oct 2012 13:05:58 -0000 Received: (qmail 10573 invoked by uid 22791); 6 Oct 2012 13:05:58 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED 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; Sat, 06 Oct 2012 13:05:48 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 26792290014; Sat, 6 Oct 2012 15:05:59 +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 67ShF1Zdvi34; Sat, 6 Oct 2012 15:05:59 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 927B2290007; Sat, 6 Oct 2012 15:05:58 +0200 (CEST) From: Eric Botcazou To: Richard Sandiford Cc: gcc-patches@gcc.gnu.org, Andrew Pinski , Uros Bizjak , Paul_Koning@dell.com, kkojima@gcc.gnu.org, aoliva@redhat.com, dje.gcc@gmail.com, uweigand@de.ibm.com, walt@tilera.com Subject: Re: RFA: Simplifying truncation and integer lowpart subregs Date: Sat, 06 Oct 2012 13:05:00 -0000 Message-ID: <7298988.0gvUXNUO8B@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.16-desktop; KDE/4.7.2; x86_64; ; ) In-Reply-To: <87fw5rojui.fsf@talisman.home> References: <6083166.IsGSDDFhFR@polaris> <87fw5rojui.fsf@talisman.home> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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: 2012-10/txt/msg00619.txt.bz2 > I think modelling it as a TRUNCATE operation is correct for > !TRULY_NOOP_TRUNCATION (it's the bug that Andrew pointed out). > And we shouldn't generate an actual TRUNCATE rtx for > TRULY_NOOP_TRUNCATION (the thing about making > simplify_gen_unary (TRUNCATE, ...) no worse than simplify_gen_subreg > for those targets). I suppose: > > /* We can't handle truncation to a partial integer mode here > because we don't know the real bitsize of the partial > integer mode. */ > if (GET_MODE_CLASS (mode) == MODE_PARTIAL_INT) > break; > > might be a problem though; we should still allow a subreg to be > generated. Is that what you were thinking of, or something else? I was thinking of the !TRULY_NOOP_TRUNCATION case, where the two operations aren't equivalent. Generating TRUNCATE in simplify_subreg seems suspicious to me in this case but, if not doing it is the source of the bug, I guess I need to do some homework on this TRULY_NOOP_TRUNCATION stuff. :-) Maybe add a blurb to the head comment of simplify_truncation, explaining that it is valid to call the function both for TRUNCATEs and truncations to the lowpart, and why it is correct to generate new TRUNCATEs in the latter case. -- Eric Botcazou