public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-5623] compare-elim: Fix an RTL checking failure
@ 2023-02-01  9:54 Richard Sandiford
  0 siblings, 0 replies; only message in thread
From: Richard Sandiford @ 2023-02-01  9:54 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:3cef9dca57ba70576dc387c40e600f00de5d55de

commit r13-5623-g3cef9dca57ba70576dc387c40e600f00de5d55de
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Wed Feb 1 09:53:50 2023 +0000

    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.

Diff:
---
 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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-01  9:54 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:54 [gcc r13-5623] 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).