compare-elim: Fix an RTL checking failure

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.

gcc/
	* compare-elim.cc (find_flags_uses_in_insn): Guard use of SET_SRC.
This commit is contained in:
Richard Sandiford 2023-02-01 09:53:50 +00:00
parent f3b1af4970
commit 3cef9dca57

View file

@ -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)