[patch, arm, testsuite] fix regression in test di-longlong64-sync-withldrexd.c

Greta Yorsh Greta.Yorsh@arm.com
Wed Jan 25 15:36:00 GMT 2012


The test gcc.target/arm/di-longlong64-sync-withldrexd.c fails on
arm-none-eabi target, because gcc generates 48 LDREXD and 48 STREXD
instructions instead of the expected 46.

FAIL: gcc.target/arm/di-longlong64-sync-withldrexd.c scan-assembler-times
tldrexd 46
FAIL: gcc.target/arm/di-longlong64-sync-withldrexd.c scan-assembler-times
tstrexd 46

An extra LDREXD and an extra STREXD instruction is generated by the
expansion of each one of the two occurrences of builtin __sync_lock_release
in the test.
The regression PASS->FAIL was introduced for target arm-none-eabi in the
first week of November 2011.
A patch related to sync_lock_release and most likely to have caused the
change(r181111):
http://gcc.gnu.org/ml/gcc-patches/2011-11/msg01039.html
Before the change, __sync_lock_release expanded into STRD, storing DI value
0.
After the change, __sync_lock_release expands into LDREXD followed by STREXD
for an atomic store of 0, which should be the correct behaviour (because
STRD does not guarantee that the store of DI value 0 is atomic).

The attached patch adjusts the test to accept the new behaviour.

gcc/testsuite/ChangeLog

2012-01-25  Greta Yorsh  <Greta.Yorsh@arm.com>

        * gcc.target/arm/di-longlong64-sync-withldrexd.c:

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test_sync_lock_release.patch.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120125/bc64f169/attachment.txt>


More information about the Gcc-patches mailing list