This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix find_reloads_subreg_address (PR rtl-optimization/42429)
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: jakub at redhat dot com
- Cc: rth at redhat dot com (Richard Henderson), ebotcazou at adacore dot com (Eric Botcazou), gcc-patches at gcc dot gnu dot org
- Date: Mon, 21 Dec 2009 14:30:14 +0100 (CET)
- Subject: Re: [PATCH] Fix find_reloads_subreg_address (PR rtl-optimization/42429)
Jakub Jelinek wrote:
> Attached are two patches, the first attempt where it adjusts MEM_SIZE only
> when MEM_OFFSET is set has been bootstrapped/regtested on x86_64-linux/trunk
> and {x86_64,i686,powerpc,powerpc64,s390,s390x}-linux on 4.4 branch. I did
> it because I wasn't sure what does MEM_SIZE mean when MEM_OFFSET isn't set,
> if it isn't the size of the whole decl. But after reading adjust_address_1
> etc., I believe it should be for non-BLKmode MEMs always the size of the
> mode, so probably the second patch (which fixes the testcase too) should be
> used instead. The MEM_ATTRS check is there to avoid creating MEM_ATTRS if
> it has none (in that case MEM_SIZE gives GET_MODE_SIZE of the mode, and we
> would needlessly create MEM_ATTRS).
I agree that something like the second patch is needed. The MEM_ATTRS test
did indeed confuse me a bit; maybe a more straightforward check would be:
if (MEM_SIZE (tem) && INTVAL (MEM_SIZE (tem)) != outer_size)
set_mem_size (tem, GEN_INT (outer_size));
But either way, the patch is OK.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com