Commit 26ff85b0 by Jakub Jelinek Committed by Jakub Jelinek

re PR target/69071 (ICE: in decompose, at rtl.h:2107 with -g)

	PR target/69071
	* lra-eliminations.c (move_plus_up): Only move plus up
	if subreg of the constant can be simplified into constant
	and use the simplified subreg of the constant instead of
	the original constant.

	* gcc.dg/pr69071.c: New test.

From-SVN: r232241
parent 655441d6
2016-01-11 Jakub Jelinek <jakub@redhat.com>
PR target/69071
* lra-eliminations.c (move_plus_up): Only move plus up
if subreg of the constant can be simplified into constant
and use the simplified subreg of the constant instead of
the original constant.
* fold-const.c (fold_convertible_p): Don't return true
for conversion of VECTOR_TYPE to same sized integral type.
(fold_convert_loc): Fix up formatting. Fold conversion of
......
......@@ -296,9 +296,14 @@ move_plus_up (rtx x)
if (GET_CODE (x) == SUBREG && GET_CODE (subreg_reg) == PLUS
&& GET_MODE_SIZE (x_mode) <= GET_MODE_SIZE (subreg_reg_mode)
&& CONSTANT_P (XEXP (subreg_reg, 1)))
return gen_rtx_PLUS (x_mode, lowpart_subreg (x_mode, subreg_reg,
subreg_reg_mode),
XEXP (subreg_reg, 1));
{
rtx cst = simplify_subreg (x_mode, XEXP (subreg_reg, 1), subreg_reg_mode,
subreg_lowpart_offset (x_mode,
subreg_reg_mode));
if (cst && CONSTANT_P (cst))
return gen_rtx_PLUS (x_mode, lowpart_subreg (x_mode, subreg_reg,
subreg_reg_mode), cst);
}
return x;
}
......
2016-01-11 Jakub Jelinek <jakub@redhat.com>
PR target/69071
* gcc.dg/pr69071.c: New test.
PR c++/69211
* g++.dg/opt/pr69211.C: New test.
......
/* PR target/69071 */
/* { dg-do compile } */
/* { dg-options "-O2 -g" } */
void *bar (void *);
void
foo (int c)
{
unsigned char bf[65400];
unsigned char *p2 = bar (bf);
unsigned char *p3 = bar (bf);
for (; *p2; p2++, c++)
{
if (c)
{
short of = p2 - bf - 6;
unsigned ofu = of;
__builtin_memcpy (p3, &ofu, sizeof (ofu));
}
}
}
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