[committed] bootstrap rtl-checking: Fix XVEC vs XVECEXP in postreload.cc

Message ID 20230606024851.D7E7920441@pchp3.se.axis.com
State Unresolved
Headers
Series [committed] bootstrap rtl-checking: Fix XVEC vs XVECEXP in postreload.cc |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Hans-Peter Nilsson June 6, 2023, 2:48 a.m. UTC
  Oops.  Sorry.  Committed as obvious.  A bootstrap
--enable-checking=yes,extra,rtl (same as the reporter, but
not the default) with the patch completed, where a bootstrap
without it failed.

-- >8 --
	PR bootstrap/110120
	* postreload.cc (reload_cse_move2add, move2add_use_add2_insn): Use
	XVECEXP, not XEXP, to access first item of a PARALLEL.
---
 gcc/postreload.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gcc/postreload.cc b/gcc/postreload.cc
index b479d4b921ba..20e138b4fa8b 100644
--- a/gcc/postreload.cc
+++ b/gcc/postreload.cc
@@ -1801,7 +1801,7 @@  move2add_use_add2_insn (scalar_int_mode mode, rtx reg, rtx sym, rtx off,
 		     naked SET, or else its single_set is the first element
 		     in a PARALLEL.  */
 		  rtx *setloc = GET_CODE (PATTERN (insn)) == PARALLEL
-		    ? &XEXP (PATTERN (insn), 0) : &PATTERN (insn);
+		    ? &XVECEXP (PATTERN (insn), 0, 0) : &PATTERN (insn);
 		  if (*setloc == set && costs_lt_p (&newcst, &oldcst, speed))
 		    {
 		      changed = validate_change (insn, setloc, new_set, 0);
@@ -2027,7 +2027,7 @@  reload_cse_move2add (rtx_insn *first)
 			  costs_add_n_insns (&oldcst, 1);
 
 			  rtx *setloc = GET_CODE (PATTERN (next)) == PARALLEL
-			    ? &XEXP (PATTERN (next), 0) : &PATTERN (next);
+			    ? &XVECEXP (PATTERN (next), 0, 0) : &PATTERN (next);
 			  if (*setloc == set
 			      && costs_lt_p (&newcst, &oldcst, speed)
 			      && have_add2_insn (reg, new_src))