]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix ICE generating uniform vector masks
authorAndrew Stubbs <ams@codesourcery.com>
Tue, 14 Nov 2023 16:07:37 +0000 (16:07 +0000)
committerAndrew Stubbs <ams@codesourcery.com>
Tue, 14 Nov 2023 16:46:39 +0000 (16:46 +0000)
Most targets have an "and" instructions for their vector mask size, but RISC-V
only has DImode "and".  Fixed by allowing wider instruction modes.

gcc/ChangeLog:

PR target/112481
* expr.cc (store_constructor): Use OPTAB_WIDEN for mask adjustment.

gcc/expr.cc

index 3e2a678710d689ad71ee48fa145fe725bccb64d9..556bcf7ef59b13cf4bdb05f6b87569474d2d84ec 100644 (file)
@@ -7489,7 +7489,7 @@ store_constructor (tree exp, rtx target, int cleared, poly_int64 size,
            if (maybe_ne (GET_MODE_PRECISION (mode), nunits))
              tmp = expand_binop (mode, and_optab, tmp,
                                  GEN_INT ((1 << nunits) - 1), target,
-                                 true, OPTAB_DIRECT);
+                                 true, OPTAB_WIDEN);
            if (tmp != target)
              emit_move_insn (target, tmp);
            break;