diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2024-07-08 03:55:27 +0200 |
---|---|---|
committer | Hans-Peter Nilsson <hp@bitrange.com> | 2024-08-27 01:07:24 +0200 |
commit | 5031df5d1f4954304c618efd2de029edc6b3699f (patch) | |
tree | 1b92c3ea2981d6887ff99f817bc34a6d3c6d56d4 /gcc | |
parent | 5cca7517c5868b7b9aa13992145eb6082ac5d5b9 (diff) | |
download | gcc-5031df5d1f4954304c618efd2de029edc6b3699f.zip gcc-5031df5d1f4954304c618efd2de029edc6b3699f.tar.gz gcc-5031df5d1f4954304c618efd2de029edc6b3699f.tar.bz2 |
combine.cc (make_more_copies): Copy attributes from the original pseudo, PR115883
The first of the late-combine passes, propagates some of the copies
made during the (in-time-)combine pass in make_more_copies into the
users of the "original" pseudo registers and removes the "old"
pseudos. That effectively removes attributes such as REG_POINTER,
which matter to LRA. The quoted PR is for an ICE-manifesting bug that
was exposed by the late-combine pass and went back to hiding with this
patch until commit r15-2937-g3673b7054ec2, the fix for PR116236, when
it was actually fixed. To wit, this patch is only incidentally
related to that bug.
In other words, the REG_POINTER attribute should not be required for
LRA to work correctly. This patch merely corrects state for those
propagated register-uses to ante late-combine.
For reasons not investigated, this fixes a failing test
"FAIL: gcc.dg/guality/pr54200.c -Og -DPREVENT_OPTIMIZATION line 20 z == 3"
for x86_64-linux-gnu.
PR middle-end/115883
* combine.cc (make_more_copies): Copy attributes from the original
pseudo to the new copy.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/combine.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/combine.cc b/gcc/combine.cc index 40e9294..fef06a6 100644 --- a/gcc/combine.cc +++ b/gcc/combine.cc @@ -15102,6 +15102,12 @@ make_more_copies (void) continue; rtx new_reg = gen_reg_rtx (GET_MODE (dest)); + + /* The "original" pseudo copies have important attributes + attached, like pointerness. We want that for these copies + too, for use by insn recognition and later passes. */ + set_reg_attrs_from_value (new_reg, dest); + rtx_insn *new_insn = gen_move_insn (new_reg, src); SET_SRC (set) = new_reg; emit_insn_before (new_insn, insn); |