Commit 220c5f0c by Jakub Jelinek Committed by Jakub Jelinek

re PR rtl-optimization/45728 (ICE: in gen_lowpart_general, at rtlhooks.c:59 at…

re PR rtl-optimization/45728 (ICE: in gen_lowpart_general, at rtlhooks.c:59 at -O1 when comparing union members)

	PR rtl-optimization/45728
	* expr.c (expand_expr_real_1): If op0 isn't REG or MEM, try
	gen_lowpart_common first and if that fails, force_reg first
	before calling gen_lowpart.

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

From-SVN: r164456
parent 0a7a6af6
2010-09-20 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/45728
* expr.c (expand_expr_real_1): If op0 isn't REG or MEM, try
gen_lowpart_common first and if that fails, force_reg first
before calling gen_lowpart.
PR middle-end/45678
* cfgexpand.c (expand_one_stack_var_at): Use
crtl->max_used_stack_slot_alignment as max_align, instead
......
......@@ -9381,7 +9381,15 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
{
if (GET_CODE (op0) == SUBREG)
op0 = force_reg (GET_MODE (op0), op0);
op0 = gen_lowpart (mode, op0);
temp = gen_lowpart_common (mode, op0);
if (temp)
op0 = temp;
else
{
if (!REG_P (op0) && !MEM_P (op0))
op0 = force_reg (GET_MODE (op0), op0);
op0 = gen_lowpart (mode, op0);
}
}
/* If both types are integral, convert from one mode to the other. */
else if (INTEGRAL_TYPE_P (type) && INTEGRAL_TYPE_P (TREE_TYPE (treeop0)))
......
2010-09-20 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/45728
* gcc.c-torture/compile/pr45728.c: New test.
2010-09-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/45081
......
/* PR rtl-optimization/45728 */
union U
{
int *m;
double d;
};
int i;
union U u;
int
foo (void)
{
union U v = { &i };
return u.d == v.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