* [pushed] compare-elim: Fix an RTL checking failure
@ 2023-02-01 9:55 Richard Sandiford
0 siblings, 0 replies; only message in thread
From: Richard Sandiford @ 2023-02-01 9:55 UTC (permalink / raw)
To: gcc-patches
find_flags_uses_in_insn used SET_SRC without first checking
for a SET. This showed up as an RTL checking failure in
g++.dg/torture/pr90994.C on aarch64.
Tested on aarch64-linux-gnu & pushed as obvious.
Richard
gcc/
* compare-elim.cc (find_flags_uses_in_insn): Guard use of SET_SRC.
---
gcc/compare-elim.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gcc/compare-elim.cc b/gcc/compare-elim.cc
index 5cbd2c027b1..c59dc0cf5a5 100644
--- a/gcc/compare-elim.cc
+++ b/gcc/compare-elim.cc
@@ -254,7 +254,8 @@ find_flags_uses_in_insn (struct comparison *cmp, rtx_insn *insn)
x = PATTERN (insn);
if (GET_CODE (x) == PARALLEL)
x = XVECEXP (x, 0, 0);
- x = SET_SRC (x);
+ if (GET_CODE (x) == SET)
+ x = SET_SRC (x);
if (GET_CODE (x) == IF_THEN_ELSE)
x = XEXP (x, 0);
if (COMPARISON_P (x)
--
2.25.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-02-01 9:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01 9:55 [pushed] compare-elim: Fix an RTL checking failure Richard Sandiford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).