2 20051104-1.c from the execute part of the gcc torture suite.
6 Optimization transformed 'if (cond) *ptr = 0;' into '*ptr = (cond) ? 0 : *ptr;'
7 and thus wrote to literal string which gives undefined behavior
8 or in the case of gcc a segmentation fault.
9 The pointer being a plain char* and assigned a literal string is essential to the bug.
10 Therefor warning 196 must be disabled.
17 #pragma disable_warning 196
20 /* PR rtl-optimization/23567 */
29 testTortureExecute (void)
33 if (s
.name
[s
.len
] != 0)