diff options
author | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-02-08 15:26:02 +0000 |
---|---|---|
committer | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-02-08 15:26:02 +0000 |
commit | 3b967909afb128008572e8ddb84033994789f771 (patch) | |
tree | e3024248b27228597cb8c312498b83acfe993d15 /gcc/optabs.c | |
parent | 3e527904ded3f4472a11d0473a5d4daca607ce77 (diff) | |
download | gcc-3b967909afb128008572e8ddb84033994789f771.tar.gz |
* optabs.c (expand_atomic_load): Do not assume compare_and_swap will
succeed for larger than word integers.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184009 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index 87cce8ef4b0..b0ecdf0513e 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. */ |