tree-optimization/107389 - honor __builtin_assume_alignment at -O0
authorRichard Biener <rguenther@suse.de>
Tue, 8 Nov 2022 12:49:16 +0000 (13:49 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 8 Nov 2022 15:38:39 +0000 (16:38 +0100)
commit7899582a059a9d8c25bfff305cd236d219dc4f20
treef528ce0356c7f144bacf2cb8d6aebb5292cc8fc7
parent215355d302d8602c7eeefb9c927a3dbb221714c8
tree-optimization/107389 - honor __builtin_assume_alignment at -O0

The following makes sure to set alignment information on the LHS
of __builtin_assume_alignment calls even when not optimizing so
uses as arguments to builtin functions like memcpy or __atomic_load_n
can be reflected at RTL expansion time.

PR tree-optimization/107389
* gimple-low.cc (lower_builtin_assume_aligned): New.
(lower_stmt): Call it.

* gcc.dg/pr107389.c: New testcase.
gcc/gimple-low.cc
gcc/testsuite/gcc.dg/pr107389.c [new file with mode: 0644]