This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]