Commit 793f1c97 by Andrew Stubbs

predicates.md (shift_amount_operand): Remove constant range check.

2011-10-07  Andrew Stubbs  <ams@codesourcery.com>

	gcc/
	* config/arm/predicates.md (shift_amount_operand): Remove constant
	range check.
	(shift_operator): Check range of constants for all shift operators.

	gcc/testsuite/
	* gcc.dg/pr50193-1.c: New file.
	* gcc.target/arm/shiftable.c: New file.

From-SVN: r179662
parent 55cdadd5
/* PR 50193: ARM: ICE on a | (b << negative-constant) */
/* Ensure that the compiler doesn't ICE. */
/* { dg-options "-O2" } */
int
foo(int a, int b)
{
return a | (b << -3); /* { dg-warning "left shift count is negative" } */
}
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-require-effective-target arm32 } */
/* ARM has shift-and-alu insns. Depending on the ALU op GCC represents some
of these as a left shift, others as a multiply. Check that we match the
right one. */
int
plus (int a, int b)
{
return (a * 64) + b;
}
/* { dg-final { scan-assembler "add.*\[al]sl #6" } } */
int
minus (int a, int b)
{
return a - (b * 64);
}
/* { dg-final { scan-assembler "sub.*\[al]sl #6" } } */
int
ior (int a, int b)
{
return (a * 64) | b;
}
/* { dg-final { scan-assembler "orr.*\[al]sl #6" } } */
int
xor (int a, int b)
{
return (a * 64) ^ b;
}
/* { dg-final { scan-assembler "eor.*\[al]sl #6" } } */
int
and (int a, int b)
{
return (a * 64) & b;
}
/* { dg-final { scan-assembler "and.*\[al]sl #6" } } */
int
rsb (int a, int b)
{
return (a * 64) - b;
}
/* { dg-final { scan-assembler "rsb.*\[al]sl #6" } } */
int
mvn (int a, int b)
{
return ~(a * 64);
}
/* { dg-final { scan-assembler "mvn.*\[al]sl #6" } } */
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