gcc/gcc/testsuite/gcc.target/m68k/pr36133.c
Andrew Stubbs 1afac9a69f re PR target/36133 (GCC creates suboptimal ASM : Code includes unneeded TST instructions)
2008-11-19  Andrew Stubbs  <ams@codesourcery.com>

	gcc/
	PR target/36133
	* config/m68k/m68k.h (CC_OVERFLOW_UNUSABLE, CC_NO_CARRY): New defines.
	* config/m68k/m68k.c (notice_update_cc): Set cc_status properly for
	shift instructions.
	* config/m68k/m68k.md: Adjust all conditional branches that use the
	carry and overflow flags so they understand CC_OVERFLOW_UNUSABLE.

	gcc/testsuite/
	PR target/36133
	* gcc.target/m68k/pr36133.c: New test.

From-SVN: r141999
2008-11-19 11:23:28 +00:00

16 lines
357 B
C

/* pr36133.c
This test ensures that conditional branches can use the condition codes
written by shift instructions, without the need for an extra TST. */
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-final { scan-assembler-not "tst" } } */
void
f (unsigned int a)
{
if (a >> 4)
asm volatile ("nop");
asm volatile ("nop");
}