Hi, PR43597 was fixed by http://gcc.gnu.org/viewcvs?view=revision&revision=172032.
This patch adds a testcase. OK for trunk? Thanks, - Tom 2011-07-18 Tom de Vries <t...@codesourcery.com> PR target/43597 * gcc.target/arm/pr43597.c: New test.
Index: gcc.target/arm/pr43597.c =================================================================== --- /dev/null (new file) +++ gcc.target/arm/pr43597.c (revision 0) @@ -0,0 +1,24 @@ +/* { dg-do assemble } */ +/* { dg-options "-Os -save-temps -mthumb" } */ + +extern int bar(); +extern void bar2(int); +int foo4() +{ + int result = 0; + int f = -1; + f = bar(); + if (f < 0) { + result = 1; + goto bail; + } + bar(); +bail: + bar2(f); + return result; +} + +/* { dg-final { scan-assembler-times "sub" 1 { target arm_thumb2_ok } } } */ +/* { dg-final { scan-assembler-times "cmp" 0 { target arm_thumb2_ok } } } */ +/* { dg-final { object-size text <= 30 { target arm_thumb2_ok } } } */ +/* { dg-final { cleanup-saved-temps "pr43597" } } */