annotate gcc/testsuite/g++.old-deja/g++.brendan/crash24.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // { dg-do assemble }
kono
parents:
diff changeset
2 // { dg-options "-O" }
kono
parents:
diff changeset
3 // GROUPS passed old-abort
kono
parents:
diff changeset
4 // gcc puts the array into a register, and then the store_bit_field () code
kono
parents:
diff changeset
5 // in expmed.c gets confused when it tries to store zero past the end of the
kono
parents:
diff changeset
6 // register (because the index is past the array bounds). It ends up calling
kono
parents:
diff changeset
7 // store_split_bit_field, which then aborts, because we don't have a split bit
kono
parents:
diff changeset
8 // field.
kono
parents:
diff changeset
9 //
kono
parents:
diff changeset
10 // Seems easiest to detect this case in the front end, i.e. access outside the
kono
parents:
diff changeset
11 // array bounds, and then force the array to be allocated on the stack instead
kono
parents:
diff changeset
12 // of a register.
kono
parents:
diff changeset
13
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
14 int
111
kono
parents:
diff changeset
15 main()
kono
parents:
diff changeset
16 {
kono
parents:
diff changeset
17 char i[1];
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 i[1] = 0;
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
20
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
21 return 0;
111
kono
parents:
diff changeset
22 }