Last updated November 6, 2003
TopCoder uses gcc 3.2.2 (Redhat 9), glibc-2.3.2, and libstdc++-3 on Linux 2.4.20-8smp, invoking the compiler as g++ -Wall -W -O2 -s -pipe. I compiled this list from the release notes for 3.2.3. There may be known bugs that were not listed in the release notes, as well as unknown bugs.
I didn't include bugs that would certainly be noticed at compile-time, such as the internal compiler errors.
Bugs were also excluded if I didn't think they could possibly be relevant in a TopCoder competition. I was pretty conservative, but I want to emphasize that I make no guarantees whatsoever about the accuracy or completeness of this information.
This list isn't as good as the Java list, because many of the gcc bugzilla reports are unclear without knowledge of gcc internals which I lack. If anyone with such knowledge wants to share it with me, I'll update this page.
Bugzilla: 9993
Summary Description: An object constructed in an infinite loop for possible use as a return value does not have its destructor called for each iteration of the loop.
Workaround: Put a dummy return statement after the loop.
Bugzilla: 8613
Summary Description: It looks like there's a problem with expanding the builtin function strlen when its result is being assigned to an lvalue that is the result of an expression with side effects, such as postincrement. Note that the bug report only mentions postincrement, but I can't imagine why it wouldn't be an issue with other expressions with side effects that don't produce a sequence point.
Workaround: Use a temporary variable.
Bugzilla: 8224
Summary Description: Expressions like (unsigned)((int)x/2)/2 will be merged into a single signed division.
Workaround: Use a temporary variable.
Bugzilla: 9853
Summary Description: Non-constant structure initializers might not be compiled correctly.
Workaround: Don't use non-constant structure initializers.
Bugzilla: 10116
Summary Description: In the context of switch statements, non-adjacent basic blocks might be merged. Unfortunately, this is terribly vague.
Workaround: Unknown.
Bugzilla: 10171
Summary Description: Non-trivial for loops that can be determined at compile time to iterate exactly once may be incorrectly unrolled.
Workaround: Don't write for loops that are guaranteed to iterate exactly once. It's pointless.