]> git.ipfire.org Git - thirdparty/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, 19 Jul 2022 09:16:34 +0000 (11:16 +0200)
commite4ff11a8f2e80adb8ada69bf35ee6a1ab18a9c85
tree4283d90f317885b033291676a4da9c7924bd08dd
parent0f129766fdb687394f0eea04f69268b5cc034cda
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.cc (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.
gcc/builtins.cc
gcc/testsuite/gfortran.dg/pr106331.f90 [new file with mode: 0644]