]> 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>
Fri, 14 Oct 2022 10:47:13 +0000 (12:47 +0200)
commitcf404eb3b55a3711134bddee98d6d8d881be8a69
treec2d5f88adf286e89047da8fb29d92b34808edf30
parenta8abbf6d15fefe5ac27aa7c21201883b66cc9b01
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]