diff options
| author | Andrew MacLeod <amacleod@redhat.com> | 2012-02-08 15:26:02 +0000 |
|---|---|---|
| committer | Andrew Macleod <amacleod@gcc.gnu.org> | 2012-02-08 15:26:02 +0000 |
| commit | c51ec0a3d68c86ba9b2e2d0c61556fee8308d570 (patch) | |
| tree | e3024248b27228597cb8c312498b83acfe993d15 | |
| parent | ea72cc1dcab80a27beb22a2c9f0b4110392ec56d (diff) | |
| download | gcc-c51ec0a3d68c86ba9b2e2d0c61556fee8308d570.zip gcc-c51ec0a3d68c86ba9b2e2d0c61556fee8308d570.tar.gz gcc-c51ec0a3d68c86ba9b2e2d0c61556fee8308d570.tar.bz2 | |
optabs.c (expand_atomic_load): Do not assume compare_and_swap will succeed for larger than word integers.
* optabs.c (expand_atomic_load): Do not assume compare_and_swap will
succeed for larger than word integers.
From-SVN: r184009
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/optabs.c | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 71cdd93..1c56ebe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2012-02-08 Andrew MacLeod <amacleod@redhat.com> + + * optabs.c (expand_atomic_load): Do not assume compare_and_swap will + always succeed for integers larger than a native word. + 2012-02-08 Richard Guenther <rguenther@suse.de> PR rtl-optimization/52170 diff --git a/gcc/optabs.c b/gcc/optabs.c index 87cce8e..b0ecdf0 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -7665,9 +7665,12 @@ expand_atomic_load (rtx target, rtx mem, enum memmodel model) /* Issue val = compare_and_swap (mem, 0, 0). This may cause the occasional harmless store of 0 when the value is already 0, but it seems to be OK according to the standards guys. */ - expand_atomic_compare_and_swap (NULL, &target, mem, const0_rtx, - const0_rtx, false, model, model); - return target; + if (expand_atomic_compare_and_swap (NULL, &target, mem, const0_rtx, + const0_rtx, false, model, model)) + return target; + else + /* Otherwise there is no atomic load, leave the library call. */ + return NULL_RTX; } /* Otherwise assume loads are atomic, and emit the proper barriers. */ |
