Tasks for GCC 4.8
Updated Feb 9, 2012
In no particular order
1. Complete non-atomic memory model support issues for data races.
- Bitfield load/store issues never got finished
- Tests for store data races and optimizer changes
- May require coordination witrh richi over a bitfield re-implementation.
2. Add C1x support.
- This brings some of the current libstdc++ functionality into the base compiler.
__Atomic() type modifier scales non-stardard type sizes to lock-free compatible sizes. Provides alignment guarantees
- stdatomic.h header file will provide a standard place for common defintions of things like MEMORY_MODEL which can be used by libgomp, TM, C++ and everything else.
- cleans up implementation by having standard defined values.
3. Promote atomic operations to tree codes.
- Allows SSA optimizers to more easily manipulate atomic operations. Builtin functions can be awkward to translate into something different.
- compare_and_swap is sub-optimal until we can manipulate its component parts more easily.
- Expose the memory model barriers to optimization
- With C1x support, it will be important to be able to create and expose temporary values to the optimizers for removal. C++ does this currently in template code, but C won't have that option.
4. Adding direction barriers to optimizers.
- RTL has the code BARRIER, and tree SSA all atomic operations are function calls. This makes all operations complete barrier to code movement in both directions. The memory model distinguishes between acquire and release barriers, which are uni-directional. The compiler should understand that those barrier types only block code motion in a single direction, not both.
- Add ACQUIRE_BARRIER and RELEASE_BARRIER to RTL, and atomic tree-codes should provide the ability within SSA.
- Requires a lot of individual optimizer tweaking I expect.
5. Audit compiler for legacy __sync uses and replace with __atomic.
The entire compiler source base should be audited for uses of __sync and replaced with the appropriate __atomic function.
- All memory model references should be replaced with uses from the new stdatomic.h.
6. Complete implementation of the new libatomic project and refine ABI.
- There will be refinements to the ABI no doubt, especially concerning alignment and tweaking of usage as atomics begin being used.
- Tightly integrate libatomic into the tool chain so that it is built with GCC if there is atomic support, and will automatically be used if the OS does not have one of its own.
- Should be multi-libed, I think.
- Try to get more general acceptance of the library by other compilers to facilitate future inclusion in the OS.
7. Add flag for multi-threaded vs single threaded.
- There are various configuration choices that can be made depending on whether the target supports or will be using multi-threaded.
- This includes data race stuff, as well as using atomics for static initialization, and libstdc++ atomic support.
- there ought to be configuration info detailing whats available, and if a target is not atomic, atomic functions should still operate non-atomically.
- May also be controlled by a compiler flag.
8. Flush out tests,
- More thorough testing rather than just the basics we do now.
- Look at finding a way to test for proper synchronization. Possibly create testcases and run then in parallel a whole bunch of times.
- Possibly a separate testsuite from gcc, maybe integrate with a libatomic testsuite.