[backport from gcc-4.7/trunk ] gcc/ 2011-10-14 David Alan Gilbert PR target/48126 * config/arm/arm.c (arm_output_sync_loop): Move label before barrier. --- gcc-4.6.1/gcc/config/arm/arm.c.~1~ 2011-05-05 10:39:40.000000000 +0200 +++ gcc-4.6.1/gcc/config/arm/arm.c 2011-10-15 20:29:31.000000000 +0200 @@ -23392,8 +23392,11 @@ arm_output_sync_loop (emit_f emit, } } - arm_process_output_memory_barrier (emit, NULL); + /* Note: label is before barrier so that in cmp failure case we still get + a barrier to stop subsequent loads floating upwards past the ldrex + PR target/48126. */ arm_output_asm_insn (emit, 1, operands, "%sLSYB%%=:", LOCAL_LABEL_PREFIX); + arm_process_output_memory_barrier (emit, NULL); } static rtx