Commit 34f1d426 by Kyrylo Tkachov Committed by Kyrylo Tkachov

[ARM] PR target/64600 Fix another ICE with -mtune=xscale: properly sign-extend…

[ARM] PR target/64600 Fix another ICE with -mtune=xscale: properly sign-extend mask during constant splitting

	PR target/64600
	* config/arm/arm.c (arm_gen_constant, AND case): Use
	ARM_SIGN_EXTEND when constructing AND mask.

	PR target/64600
	* gcc.target/arm/pr64600_1.c: New test.

From-SVN: r221413
parent 7088e2b0
2015-03-13 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/64600
* config/arm/arm.c (arm_gen_constant, AND case): Use
ARM_SIGN_EXTEND when constructing AND mask.
2015-03-13 Thomas Preud'homme <thomas.preudhomme@arm.com> 2015-03-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
* graph.c (print_graph_cfg): Make function names visible and append * graph.c (print_graph_cfg): Make function names visible and append
......
...@@ -4536,19 +4536,20 @@ arm_gen_constant (enum rtx_code code, machine_mode mode, rtx cond, ...@@ -4536,19 +4536,20 @@ arm_gen_constant (enum rtx_code code, machine_mode mode, rtx cond,
if ((remainder | shift_mask) != 0xffffffff) if ((remainder | shift_mask) != 0xffffffff)
{ {
HOST_WIDE_INT new_val
= ARM_SIGN_EXTEND (remainder | shift_mask);
if (generate) if (generate)
{ {
rtx new_src = subtargets ? gen_reg_rtx (mode) : target; rtx new_src = subtargets ? gen_reg_rtx (mode) : target;
insns = arm_gen_constant (AND, mode, cond, insns = arm_gen_constant (AND, SImode, cond, new_val,
remainder | shift_mask,
new_src, source, subtargets, 1); new_src, source, subtargets, 1);
source = new_src; source = new_src;
} }
else else
{ {
rtx targ = subtargets ? NULL_RTX : target; rtx targ = subtargets ? NULL_RTX : target;
insns = arm_gen_constant (AND, mode, cond, insns = arm_gen_constant (AND, mode, cond, new_val,
remainder | shift_mask,
targ, source, subtargets, 0); targ, source, subtargets, 0);
} }
} }
...@@ -4571,12 +4572,13 @@ arm_gen_constant (enum rtx_code code, machine_mode mode, rtx cond, ...@@ -4571,12 +4572,13 @@ arm_gen_constant (enum rtx_code code, machine_mode mode, rtx cond,
if ((remainder | shift_mask) != 0xffffffff) if ((remainder | shift_mask) != 0xffffffff)
{ {
HOST_WIDE_INT new_val
= ARM_SIGN_EXTEND (remainder | shift_mask);
if (generate) if (generate)
{ {
rtx new_src = subtargets ? gen_reg_rtx (mode) : target; rtx new_src = subtargets ? gen_reg_rtx (mode) : target;
insns = arm_gen_constant (AND, mode, cond, insns = arm_gen_constant (AND, mode, cond, new_val,
remainder | shift_mask,
new_src, source, subtargets, 1); new_src, source, subtargets, 1);
source = new_src; source = new_src;
} }
...@@ -4584,8 +4586,7 @@ arm_gen_constant (enum rtx_code code, machine_mode mode, rtx cond, ...@@ -4584,8 +4586,7 @@ arm_gen_constant (enum rtx_code code, machine_mode mode, rtx cond,
{ {
rtx targ = subtargets ? NULL_RTX : target; rtx targ = subtargets ? NULL_RTX : target;
insns = arm_gen_constant (AND, mode, cond, insns = arm_gen_constant (AND, mode, cond, new_val,
remainder | shift_mask,
targ, source, subtargets, 0); targ, source, subtargets, 0);
} }
} }
......
2015-03-13 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/64600
* gcc.target/arm/pr64600_1.c: New test.
2015-03-12 Kyrylo Tkachov <kyrylo.tkachov@arm.com> 2015-03-12 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR rtl-optimization/65235 PR rtl-optimization/65235
......
/* { dg-do compile } */
/* { dg-options "-O2 -mtune=xscale" } */
typedef unsigned int speed_t;
typedef unsigned int tcflag_t;
struct termios {
tcflag_t c_cflag;
};
speed_t
cfgetospeed (const struct termios *tp)
{
return tp->c_cflag & 010017;
}
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