From: Jakub Jelinek Date: Fri, 19 Apr 2019 11:58:11 +0000 (+0200) Subject: re PR middle-end/90139 (ICE in emit_block_move_hints, at expr.c:1601) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a7bfaee58fea4f4b08e96bc3ba991a5fc164864c;p=gcc.git re PR middle-end/90139 (ICE in emit_block_move_hints, at expr.c:1601) PR middle-end/90139 * tree-outof-ssa.c (get_temp_reg): If reg_mode is BLKmode, return assign_temp instead of gen_reg_rtx. * gcc.c-torture/compile/pr90139.c: New test. From-SVN: r270457 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d160ddfb728..5327dcda6f3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-04-19 Jakub Jelinek + + PR middle-end/90139 + * tree-outof-ssa.c (get_temp_reg): If reg_mode is BLKmode, return + assign_temp instead of gen_reg_rtx. + 2019-04-19 Christophe Lyon PR translation/90118 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0b5c3439bc9..7458b4cc2ef 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2019-04-19 Jakub Jelinek + PR middle-end/90139 + * gcc.c-torture/compile/pr90139.c: New test. + PR c++/90138 * g++.dg/template/pr90138.C: New test. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr90139.c b/gcc/testsuite/gcc.c-torture/compile/pr90139.c new file mode 100644 index 00000000000..f3d99f04c86 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr90139.c @@ -0,0 +1,20 @@ +/* PR middle-end/90139 */ + +typedef float __attribute__((vector_size (sizeof (float)))) V; +void bar (int, V *); +int l; + +void +foo (void) +{ + V n, b, o; + while (1) + switch (l) + { + case 0: + o = n; + n = b; + b = o; + bar (1, &o); + } +} diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c index 6cac55bde06..713b0b0666c 100644 --- a/gcc/tree-outof-ssa.c +++ b/gcc/tree-outof-ssa.c @@ -653,6 +653,8 @@ get_temp_reg (tree name) tree type = TREE_TYPE (name); int unsignedp; machine_mode reg_mode = promote_ssa_mode (name, &unsignedp); + if (reg_mode == BLKmode) + return assign_temp (type, 0, 0); rtx x = gen_reg_rtx (reg_mode); if (POINTER_TYPE_P (type)) mark_reg_pointer (x, TYPE_ALIGN (TREE_TYPE (type)));