]> git.ipfire.org Git - people/ms/gcc.git/commit
middle-end/106331 - fix mem attributes for string op arguments
authorRichard Biener <rguenther@suse.de>
Tue, 19 Jul 2022 07:57:22 +0000 (09:57 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 11 Oct 2022 13:03:46 +0000 (15:03 +0200)
commit90d3b4dd84c08cc134578397d9c6b30b7dc4b440
tree556944e03d8cd322c910d8bf00e83f6ff091959d
parentbefa9c8b072ef8b81d4a5b46d83f81cd58318c2b
middle-end/106331 - fix mem attributes for string op arguments

get_memory_rtx tries hard to come up with a MEM_EXPR to record
in the memory attributes but in the last fallback fails to properly
account for an unknown offset and thus, as visible in this testcase,
incorrect alignment computed from set_mem_attributes.  The following
rectifies both parts.

PR middle-end/106331
* builtins.c (get_memory_rtx): Compute alignment from
the original address and set MEM_OFFSET to unknown when
we create a MEM_EXPR from the base object of the address.

* gfortran.dg/pr106331.f90: New testcase.

(cherry picked from commit e4ff11a8f2e80adb8ada69bf35ee6a1ab18a9c85)
gcc/builtins.c
gcc/testsuite/gfortran.dg/pr106331.f90 [new file with mode: 0644]