sparc: Treat instructions with length 0 as empty

Message ID 20240105071913.593978-3-cederman@gaisler.com
State Accepted
Headers
Series sparc: Treat instructions with length 0 as empty |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Daniel Cederman Jan. 5, 2024, 7:19 a.m. UTC
  This is to handle the membar_empty instruction that can be generated
when compiling for UT699.

gcc/ChangeLog:

	* config/sparc/sparc.cc (next_active_non_empty_insn): Length 0 treated as empty
---
 gcc/config/sparc/sparc.cc | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Eric Botcazou Jan. 8, 2024, 9:26 a.m. UTC | #1
> This is to handle the membar_empty instruction that can be generated
> when compiling for UT699.
> 
> gcc/ChangeLog:
> 
> 	* config/sparc/sparc.cc (next_active_non_empty_insn): Length 0 treated as empty

OK without the superfluous parentheses.
  

Patch

diff --git a/gcc/config/sparc/sparc.cc b/gcc/config/sparc/sparc.cc
index 62c57cc53159..8970674004b3 100644
--- a/gcc/config/sparc/sparc.cc
+++ b/gcc/config/sparc/sparc.cc
@@ -1119,6 +1119,7 @@  next_active_non_empty_insn (rtx_insn *insn)
   while (insn
 	 && (GET_CODE (PATTERN (insn)) == UNSPEC_VOLATILE
 	     || GET_CODE (PATTERN (insn)) == ASM_INPUT
+	     || (get_attr_length (insn) == 0)
 	     || (USEFUL_INSN_P (insn)
 		 && (asm_noperands (PATTERN (insn)) >= 0)
 		 && !strcmp (decode_asm_operands (PATTERN (insn),