Commit 37d7267f by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/89412 (gcc ICE in simplify_subreg, at simplify-rtx.c:6273 on i686-linux-gnu)

	PR middle-end/89412
	* expr.c (expand_assignment): If result is a MEM, use change_address
	instead of simplify_gen_subreg.

	* gcc.c-torture/compile/pr89412.c: New test.

From-SVN: r269057
parent cd56fb79
2019-02-20 Jakub Jelinek <jakub@redhat.com> 2019-02-20 Jakub Jelinek <jakub@redhat.com>
PR middle-end/89412
* expr.c (expand_assignment): If result is a MEM, use change_address
instead of simplify_gen_subreg.
2019-02-20 Jakub Jelinek <jakub@redhat.com>
David Malcolm <dmalcolm@redhat.com> David Malcolm <dmalcolm@redhat.com>
PR middle-end/89091 PR middle-end/89091
......
...@@ -5211,9 +5211,13 @@ expand_assignment (tree to, tree from, bool nontemporal) ...@@ -5211,9 +5211,13 @@ expand_assignment (tree to, tree from, bool nontemporal)
} }
else else
{ {
rtx from_rtx rtx from_rtx;
= simplify_gen_subreg (to_mode, result, if (MEM_P (result))
TYPE_MODE (TREE_TYPE (from)), 0); from_rtx = change_address (result, to_mode, NULL_RTX);
else
from_rtx
= simplify_gen_subreg (to_mode, result,
TYPE_MODE (TREE_TYPE (from)), 0);
if (from_rtx) if (from_rtx)
{ {
emit_move_insn (XEXP (to_rtx, 0), emit_move_insn (XEXP (to_rtx, 0),
......
2019-02-20 Jakub Jelinek <jakub@redhat.com> 2019-02-20 Jakub Jelinek <jakub@redhat.com>
PR middle-end/89412
* gcc.c-torture/compile/pr89412.c: New test.
2019-02-20 Jakub Jelinek <jakub@redhat.com>
David Malcolm <dmalcolm@redhat.com> David Malcolm <dmalcolm@redhat.com>
PR middle-end/89091 PR middle-end/89091
......
/* PR middle-end/89412 */
struct S { double a, b; } d;
int e;
double f;
void
foo ()
{
_Complex double h;
while (e)
{
f = h;
*(struct S *) &h = d;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment