[committed] pru: Handle vector modes in CLZ_DEFINED_VALUE_AT_ZERO

Dimitar Dimitrov dimitar@dinux.eu
Sun Oct 11 16:54:57 GMT 2026


Commit r17-5047-gd2e1b1248a17d0 started passing the vector mode instead
of scalar mode to CLZ_DEFINED_VALUE_AT_ZERO.  This resulted in build
failure for pru-unknown-elf:

  .../gcc/gcc/config/pru/pru.h:576:48: error: cannot convert ‘poly_int<1, long int>’ to ‘int’ in assignment
    576 |         ((VALUE) = GET_MODE_BITSIZE (MODE) - 1 - 32, 2)

Fix by using GET_MODE_UNIT_BITSIZE, the same way the original patch did
for other targets.

Pushed to trunk as r17-5062-g6ae2ad3169ab88.

gcc/ChangeLog:

	* config/pru/pru.h (CLZ_DEFINED_VALUE_AT_ZERO): Use
	GET_MODE_UNIT_BITSIZE.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
---
 gcc/config/pru/pru.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/pru/pru.h b/gcc/config/pru/pru.h
index a370d08c385..c36b8cfd257 100644
--- a/gcc/config/pru/pru.h
+++ b/gcc/config/pru/pru.h
@@ -573,7 +573,7 @@ do {									\
 
 /* See definition of clz pattern for rationale of the value.  */
 #define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE)	\
-	((VALUE) = GET_MODE_BITSIZE (MODE) - 1 - 32, 2)
+	((VALUE) = GET_MODE_UNIT_BITSIZE (MODE) - 1 - 32, 2)
 
 /* Jumps are cheap on PRU.  */
 #define LOGICAL_OP_NON_SHORT_CIRCUIT		0
-- 
2.55.0



More information about the Gcc-patches mailing list