PR middle-end/79805
commitc35e53b169ad9b7b174b6222a189ea783c4eefea
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 3 Mar 2017 19:32:01 +0000 (3 19:32 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 3 Mar 2017 19:32:01 +0000 (3 19:32 +0000)
tree850d9624575d4fb7c5cae0530b162295dd6d438e
parent2b1a8f9298ef4a73d06b8182481c756d89a47449
PR middle-end/79805
* internal-fn.def (ATOMIC_BIT_TEST_AND_SET, ATOMIC_BIT_TEST_AND_RESET,
ATOMIC_BIT_TEST_AND_COMPLEMENT, ATOMIC_COMPARE_EXCHANGE): Remove
ECF_NOTHROW.
* gimple-fold.c (fold_builtin_atomic_compare_exchange): Set
gimple_call_nothrow_p flag based on whether original builtin can throw.
If it can, emit following stmts on the fallthrough edge.
* tree-ssa-ccp.c (optimize_atomic_bit_test_and): Similarly, except
don't create new bb if inserting just debug stmts on the edge, try to
insert them on the fallthru bb or just reset debug stmts.

* g++.dg/opt/pr79805.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245882 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/gimple-fold.c
gcc/internal-fn.def
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr79805.C [new file with mode: 0644]
gcc/tree-ssa-ccp.c