On 11/4/24 3:48 AM, Richard Biener wrote:
When we end up expanding a SSA name copy with BLKmode regs which can
happen for vectors, possibly wrapped in a NOP-conversion or
a PAREN_EXPR and we are not optimizing we can end up with two
BLKmode MEMs that expand_gimple_stmt_1 doesn't properly handle
when expanding, trying to emit_move_insn them.  Looking at store_expr
which what expand_gimple_stmt_1 is really doing reveals a lot of
magic that's missing.  It eventually falls back to emit_block_move
(store_expr isn't exported), so this is what I ended up using here
given I think we'll only have BLKmode "registers" for vectors.

Bootstrap and regtest running on x86_64-unknown-linux-gnu.  OK?

Thanks,
Richard.

        PR middle-end/117433
        * cfgexpand.cc (expand_gimple_stmt_1): Use emit_block_move
        when moving temp to BLKmode target.

        * gcc.dg/pr117433.c: New testcase.
We can certainly get BLKmode for structure passing/returns in addition to the vector cases.

But yes, if we're getting BLKmode here legitimately, then the thing to do is use emit_block_move. So OK.

jeff

Reply via email to