On 11/04/2011 11:53 AM, Andrew MacLeod wrote:
OK, finally finished creating proper changelogs. I'll just throw all
8 of them in this one file if anyone wants to see then...
And here they are compressed down to what will actually be checked into
the 5 different ChangeLogs, matching the format I see for other branch
merges:
c-family/ChangeLog
==================
2011-11-06 Andrew MacLeod <amacl...@redhat.com>
Richard Henderson <r...@redhat.com>
Merged from cxx-mem-model.
* c-cppbuiltin.c (c_cpp_builtins): Test both atomic and sync patterns.
* c-common.c (sync_resolve_params, sync_resolve_return): Only tweak
parameters that are the same type size.
(get_atomic_generic_size): New. Find size of generic
atomic function parameters and do typechecking.
(add_atomic_size_parameter): New. Insert size into parameter list.
(resolve_overloaded_atomic_exchange): Restructure __atomic_exchange to
either __atomic_exchange_n or external library call.
(resolve_overloaded_atomic_compare_exchange): Restructure
__atomic_compare_exchange to either _n variant or external library call.
(resolve_overloaded_atomic_load): Restructure __atomic_load to either
__atomic_load_n or an external library call.
(resolve_overloaded_atomic_store): Restructure __atomic_store to either
__atomic_store_n or an external library call.
(resolve_overloaded_builtin): Handle new __atomic builtins.
fortran/ChangeLog
=================
2011-11-06 Andrew MacLeod <amacl...@redhat.com>
Aldy Hernandez <al...@redhat.com>
Merged from cxx-mem-model.
* types.def: (BT_SIZE, BT_CONST_VOLATILE_PTR, BT_FN_VOID_INT,
BT_FN_I{1,2,4,8,16}_CONST_VPTR_INT, BT_FN_VOID_VPTR_INT,
BT_FN_BOOL_VPTR_INT, BT_FN_BOOL_SIZE_CONST_VPTR,
BT_FN_VOID_VPTR_I{1,2,4,8,16}_INT, BT_FN_VOID_SIZE_VPTR_PTR_INT,
BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT, BT_FN_VOID_SIZE_VPTR_PTR_PTR_INT,
BT_FN_BOOL_VPTR_PTR_I{1,2,4,8,16}_BOOL_INT_INT,
BT_FN_I{1,2,4,8,16}_VPTR_I{1,2,4,8,16}_INT): New types.
gcc/ChangeLog
=============
2011-11-06 Andrew Macleod <amacl...@redhat.com>
Richard Henderson <r...@redhat.com>
Aldy Hernandez <al...@redhat.com>
Merged from cxx-mem-model.
* cppbuiltin.c (define__GNUC__): Define __ATOMIC memory models
* coretypes.h (enum memmodel): New. enumerated memory model type.
* Makefile.in (cppbuiltin.o) Add missing dependency on $(TREE_H)
* genopinit,c (optabs): Add atomic direct optab handlers.
* sync-builtins.def (BUILT_IN_ATOMIC_*): New builtins.
* builtin-types.def (BT_CONST_VOLATILE_PTR,
BT_FN_I{1,2,4,8,16}_CONST_VPTR_INT, BT_FN_VOID_VPTR_INT,
BT_FN_BOOL_VPTR_INT, BT_FN_BOOL_SIZE_CONST_VPTR,
BT_FN_I{1,2,4,8,16}_VPTR_I{1,2,4,8,16}_INT,
BT_FN_VOID_VPTR_I{1,2,4,8,16}_INT, BT_FN_VOID_SIZE_VPTR_PTR_INT,
BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT, BT_FN_VOID_SIZE_VPTR_PTR_PTR_INT,
BT_FN_BOOL_VPTR_PTR_I{1,2,4,8,16}_BOOL_INT_INT): New builtin types.
* expr.h (expand_atomic_*): Add prototypes.
(expand_{bool,val}_compare_and_swap): Remove prototypes.
* c-typeck.c (build_function_call_vec): Don't reprocess __atomic
parameters.
* common.opt (Winvalid-memory-model): New warning flag.
(finline-atomics): New. Flag to disable atomic inlining.
* params.h (ALLOW_LOAD_DATA_RACES): New.
(ALLOW_PACKED_LOAD_DATA_RACES): New.
(ALLOW_PACKED_STORE_DATA_RACES): New.
* params.def (PARAM_ALLOW_LOAD_DATA_RACES): New.
(PARAM_ALLOW_PACKED_LOAD_DATA_RACES): New.
(PARAM_ALLOW_PACKED_STORE_DATA_RACES): New.
* builtins.c (is_builtin_name): Handle __atomic.
(get_memmodel): New. Extract memory model.
(expand_expr_force_mode): New. Factor out common code for ensuring an
integer argument is in the proper mode.
(expand_builtin_sync_operation): Remove ignore param. Always call
expand_atomic_fetch_op instead of the old expanders.
(expand_builtin_compare_and_swap,
expand_builtin_sync_lock_test_and_set): Use expand_expr_force_mode,
call atomic expanders instead of sync expanders.
(expand_builtin_sync_lock_release): Call atomic_store expander.
(expand_builtin_atomic_compare_exchange, expand_builtin_atomic_load,
expand_builtin_atomic_store, expand_builtin_atomic_fetch_op): New.
(expand_builtin_atomic_exchange): New.
(fold_builtin_atomic_always_lock_free,
expand_builtin_atomic_always_lock_free,
fold_builtin_atomic_is_lock_free, expand_builtin_atomic_is_lock_free):
New.
(expand_builtin_mem_thread_fence, expand_builtin_atomic_thread_fence,
expand_builtin_atomic_signal_fence): New.
(expand_builtin_mem_signal_fence): New.
(expand_builtin): Add cases for BUILT_IN_ATOMIC_*.
(fold_builtin_2): Add cases for BUILT_IN_ATOMIC_{IS,ALWAYS}_LOCK_FREE.
* optabs.h (DOI_atomic_*): Define new atomics.
(atomic_*_optab): Define.
(can_compare_and_swap_p, expand_atomic_compare_and_swap): New
prototypes.
* optabs.c (expand_sync_operation, expand_sync_fetch_operation): Remove.
(expand_sync_lock_test_and_set): Remove.
(expand_atomic_load, expand_atomic_store): New.
(expand_atomic_exchange): New.
(expand_atomic_compare_and_swap): New. Implements
atomic_compare_exchange via compare and swap.
(struct atomic_op_functions): Opcode table struct for fetch ops.
(get_atomic_op_for_code): New. Return an opcode table entry.
(maybe_emit_op): New. Try to emit a fetch op.
(expand_atomic_fetch_op): New.
(expand_val_compare_and_swap_1): Remove.
(expand_val_compare_and_swap, expand_bool_compare_and_swap): Remove.
(expand_atomic_compare_and_swap): Rename from
expand_atomic_compare_exchange. Rewrite to return both success and
oldval return values; expand via both atomic and sync optabs.
(can_compare_and_swap_p): New.
(expand_compare_and_swap_loop): Use expand_atomic_compare_and_swap.
(maybe_gen_insn): Handle 7 and 8 operands.
* omp-low.c (expand_omp_atomic_fetch_op): Don't test individual
fetch_op optabs, only test can_compare_and_swap_p. Use __atomic
builtins instead of __sync builtins.
(expand_omp_atomic_pipeline): Use can_compare_and_swap_p.
* doc/extend.texi: Document __atomic built-in functions.
* doc/invoke.texi: Document data race parameters.
* doc/md.texi: Document atomic patterns.
* config/i386/i386.md (UNSPEC_MOVA): New.
(UNSPECV_CMPXCHG): Split into ...
(UNSPECV_CMPXCHG_1, UNSPECV_CMPXCHG_2,
UNSPECV_CMPXCHG_3, UNSPECV_CMPXCHG_4): New.
* config/i386/sync.md (ATOMIC): New mode iterator.
(atomic_load<ATOMIC>, atomic_store<ATOMIC>): New.
(atomic_loaddi_fpu, atomic_storedi_fpu, movdi_via_fpu): New.
(mem_thread_fence): Rename from memory_barrier.
Handle the added memory model parameter.
(mfence_nosse): Rename from memory_barrier_nosse.
(sync_compare_and_swap<CASMODE>): Split into ...
(atomic_compare_and_swap<SWI124>): this and ...
(atomic_compare_and_swap<CASMODE>): this. Handle the new parameters.
(atomic_compare_and_swap_single<SWI>): Rename from
sync_compare_and_swap<SWI>; rewrite to use split unspecs.
(atomic_compare_and_swap_double<DCASMODE>): Rename from
sync_double_compare_and_swap<DCASMODE>; rewrite to use split unspecs.
(*atomic_compare_and_swap_doubledi_pic): Rename from
sync_double_compare_and_swapdi_pic; rewrite to use split unspecs.
(atomic_fetch_add<SWI>): Rename from sync_old_add<SWI>; add memory
model parameter.
(*atomic_fetch_add_cmp<SWI>): Similarly.
(atomic_add<SWI>, atomic<any_logic><SWI>): Similarly.
(atomic_sub<SWI>): Similarly. Use x86_maybe_negate_const_int.
(sync_lock_test_and_set<SWI>): Merge with ...
(atomic_exchange<SWI>): ... this.
libstdc++v3/ChangeLog
=====================
2011-11-06 Benjamin Kosnik <b...@redhat.com>
Andrew MacLeod <amacl...@redhat.com>
Merged from cxx-mem-model.
* include/Makefile.am (bits_headers): Remove atomic_0.h, atomic_2.h.
* include/Makefile.in: Regenerate.
* src/Makefile.am (sources): Rename atomic.cc to
compatibility-atomic-c++0x.cc.
* src/Makefile.in: Regenerate.
* include/bits/atomic_0.h: Remove.
* include/bits/atomic_2.h: Incorporate into...
* include/bits/atomic_base.h: ...this. Use new __atomic routines.
* include/std/atomic: Add generic atomic calls to basic atomic class.
* src/atomic.cc: Move...
* src/compatibility-atomic-c++0x.cc: ...here.
* src/compatibility-c++0x.cc: Tweak.
* testsuite/29_atomics/atomic/cons/user_pod.cc: Fix.
* testsuite/29_atomics/atomic/requirements/explicit_instantiation/1.cc:
Same.
* testsuite/29_atomics/headers/atomic/macros.cc: Same.
gcc/testsuite/ChangeLog
=======================
2011-11-06 Andrew MacLeod <amacl...@redhat.com>
Richard Henderson <r...@redhat.com>
Aldy Hernandez <al...@redhat.com>
Merged from cxx-mem-model.
* lib/target-supports.exp (check_effective_target_sync_int_128,
check_effective_target_sync_long_long): Check whether the target
supports 64 and 128 bit __sync builtins.
(check_effective_target_cas_char): New.
(check_effective_target_cas_int): New.
* gcc.dg/dg.exp: Exclude simulate-thread tests.
* gcc.dg/atomic-noinline[-aux].c: New. Make a variety of atomics calls.
* gcc.dg/atomic-generic[-aux].c: New. Test that generic functions
produce the expected library calls.
* gcc.dg/atomic-fence.c: New functional tests.
* gcc.dg/atomic-param.c: New. Checl for illegal number of parameters.
* gcc.dg/atomic-invalid.c: New. Test invalid parameters.
* gcc.dg/atomic-lockfree[-aux].c: New tests.
* gcc.dg/atomic-compare-exchange-{1-5}.c: New functional tests.
* gcc.dg/atomic-op-[1-5].c: New. Test atomic fetch functionality.
* gcc.dg/atomic-exchange-{1-5}.c: New functional tests.
* gcc.dg/atomic-load-{1-5}.c: New functional tests.
* gcc.dg/atomic-store-{1-5}.c: New functional tests.
* gcc.dg/simulate-thread/atomic-load-int128.c: New. Verify int128 loads
are atomic.
* gcc.dg/simulate-thread/atomic-load-longlong.c: New. Verify 8 byte
loads are atomic.
* gcc.dg/simulate-thread/atomic-load-int.c: New. Verify 4 byte loads
are atomic.
* gcc.dg/simulate-thread/atomic-load-short.c: New. Verify 2 byte loads
are atomic.
* gcc.dg/simulate-thread/atomic-other-int128.c: New. Verify other
int128 operations are atomic.
* gcc.dg/simulate-thread/atomic-other-int.c: New. Verify other 4 byte
operations are atomic.
* gcc.dg/simulate-thread/atomic-other-longlong.c: New. Verify 8 byte
operations are atomic.
* gcc.dg/simulate-thread/atomic-other-short.c: New. Verify other 2 byte
operations are atomic.
* gcc.dg/simulate-thread/speculative-store.c: New. Verify speculative
stores aren't moved out of a loop.
* gcc.dg/simulate-thread/strict-align-global.c: New. Verify small
globals don't overwrite neighbouring globals.
* gcc.dg/simulate-thread/subfields.c: New. Verify struct component
writes dont overwrite neighbouring components.
* c-c++-common/gomp/atomic-10.c: Use cas_int; match __atomic builtin.
* c-c++-common/gomp/atomic-3.c: Likewise.
* c-c++-common/gomp/atomic-9.c: Likewise.
* gcc.dg/gomp/atomic-1.c, gcc.dg/gomp/atomic-2.c,
gcc.dg/gomp/atomic-3.c, gcc.dg/gomp/atomic-4.c, gcc.dg/gomp/atomic-7.c,
gcc.dg/gomp/atomic-8.c, gcc.dg/gomp/atomic-9.c,
gcc.dg/gomp/atomic-10.c, gcc.dg/gomp/atomic-12.c,
gcc.dg/gomp/atomic-13.c, gcc.dg/gomp/atomic-14.c,
gcc.dg/gomp/atomic-15.c: Move to c-c++-common/gomp/.
* g++.dg/gomp/atomic-1.C, g++.dg/gomp/atomic-2.C,
g++.dg/gomp/atomic-3.C, g++.dg/gomp/atomic-4.C, g++.dg/gomp/atomic-7.C,
g++.dg/gomp/atomic-8.C, g++.dg/gomp/atomic-9.C,
g++.dg/gomp/atomic-10.C, g++.dg/gomp/atomic-11.C,
g++.dg/gomp/atomic-12.C, g++.dg/gomp/atomic-13.C,
g++.dg/gomp/atomic-15.C: Remove.
* gcc.dg/gomp/gomp.exp, g++.dg/gomp/gomp.exp: Run c-c++-common tests.