diff options
| author | Andrew Pinski <andrew.pinski@oss.qualcomm.com> | 2025-10-24 17:13:26 -0700 |
|---|---|---|
| committer | Andrew Pinski <andrew.pinski@oss.qualcomm.com> | 2025-10-26 17:35:54 -0700 |
| commit | 8590b32deac05e6eb368b72bd353749134120a1f (patch) | |
| tree | 1095bb702981dd9c1f92972149796220a62d1cf4 /gcc/value-range-storage.h | |
| parent | 596633aa809b7525866d53d137f621583fe4a589 (diff) | |
| download | gcc-master.zip gcc-master.tar.gz gcc-master.tar.bz2 | |
After r16-4081-g966cdec2b2 which added folding of __builtin_assume_aligned,
forwprop would propagate pointers that lower alignment replacing ones with
greater alignment. This causes us to lose alignment information that
__builtin_assume_aligned provided to expand. Normally this just loses some
optimizations except in the s390 case where the alignment is specifically
checked and was for inlining of the atomics; without this patch an infininite
loop would happen.
Note this was previously broken for -Og before r16-4081-g966cdec2b2. This
fixes -Og case as forwprop is used instead of copyprop.
This moves the testcase for pr107389.c to torture to get a generic testcase.
pr107389.c was originally for -O0 case but we should test for other
optimization levels so this is not lost again.
align-5.c is xfailed because __builtin_assume_aligned is not instrumented for ubsan
alignment and ubsan check to see pointer is aligned before emitting a check for the
load (based on the known alignment in compiling). See PR 122038 too. I had mentioned
this issue previously in r16-4081-g966cdec2b2 too.
PR middle-end/107389
PR tree-optimization/122086
gcc/ChangeLog:
* tree-ssa-forwprop.cc (forwprop_may_propagate_copy): New function.
(pass_forwprop::execute): Use forwprop_may_propagate_copy
instead of may_propagate_copy.
gcc/testsuite/ChangeLog:
* gcc.dg/pr107389.c: Move to...
* gcc.dg/torture/pr107389.c: ...here. Skip for lto.
Use dg-additional-options rather than dg-options.
* c-c++-common/ubsan/align-5.c: xfail.
Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
Diffstat (limited to 'gcc/value-range-storage.h')
0 files changed, 0 insertions, 0 deletions
