PR target/98743: Fix ICE in convert_move for RISC-V
authorKito Cheng <kito.cheng@sifive.com>
Fri, 22 Jan 2021 08:29:09 +0000 (16:29 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Tue, 2 Feb 2021 08:56:06 +0000 (16:56 +0800)
commitbc7c2b34c34f21ea58198ba58a48eb065bdda25d
tree1e790669a1a090b73234f5eae23f5b1494af6baa
parent250fd9fb118a6897e6c824a0faac634861ea7716
PR target/98743: Fix ICE in convert_move for RISC-V

 - Check `from` mode is not BLMmode before call store_expr, calling store_expr
   with BLKmode will cause ICE.

 - Verified with riscv64, x86_64 and aarch64, no introduce new regression.

Note: Those logic was introduced by 3e60ddeb8220ed388819bb3f14e8caa9309fd3c2,
      so I cc Jakub for reivew.

Changes for V2:

 - Checking mode of `from` rather than mode of `to`.
 - Verified on riscv64, x86_64 and aarch64 again.

gcc/ChangeLog:

PR target/98743
* expr.c: Check mode before calling store_expr.

gcc/testsuite/ChangeLog:

PR target/98743
* g++.dg/opt/pr98743.C: New.
gcc/expr.c
gcc/testsuite/g++.dg/opt/pr98743.C [new file with mode: 0644]