From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19946 invoked by alias); 31 Jan 2012 18:29:55 -0000 Received: (qmail 19935 invoked by uid 22791); 31 Jan 2012 18:29:53 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_FW X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 31 Jan 2012 18:29:36 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/52055] load of 64-bit pointer reads 64 bits even when only 32 are used Date: Tue, 31 Jan 2012 19:02: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-Keywords: missed-optimization X-Bugzilla-Severity: minor X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2012-01/txt/msg03713.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52055 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek 2012-01-31 18:29:33 UTC --- Combine can already do this kind of change, as can be seen e.g. on void foo (unsigned long long *p) { asm volatile ("" : : "rm" ((unsigned) *p)); } where combine shortens the load into SImode load, but on this testcase we don't attempt to combine it, because cant_combine_insn_p on the insn with subreg says we shouldn't combine it (the src is a subreg:SI of the reg:DI initialized by the DImode memory load, but dest is hard register %eax, which has likely spilled register class). So, shell we do this kind of shortening in fwprop instead? If a MEM load has all uses subregged to a narrower mode, try to subreg it and adjust the callers?