2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.brendan / crash24.C
blob42d0fabc2382b08ab614fc0f9e5c447924b8dc82
1 // { dg-do assemble  }
2 // { dg-options "-O" }
3 // GROUPS passed old-abort
4 // gcc puts the array into a register, and then the store_bit_field () code
5 // in expmed.c gets confused when it tries to store zero past the end of the
6 // register (because the index is past the array bounds).   It ends up calling
7 // store_split_bit_field, which then aborts, because we don't have a split bit
8 // field.
9 //
10 // Seems easiest to detect this case in the front end, i.e. access outside the
11 // array bounds, and then force the array to be allocated on the stack instead
12 // of a register.
14 main()
16   char i[1];
18   i[1] = 0;