diff options
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/20001226-1.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr78162.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr78170.c | 39 |
3 files changed, 49 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/20001226-1.c b/gcc/testsuite/gcc.c-torture/compile/20001226-1.c index 127c4daec45..687b43a6bcb 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20001226-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/20001226-1.c @@ -1,7 +1,6 @@ /* { dg-do assemble } */ /* { dg-skip-if "too much code for avr" { "avr-*-*" } { "*" } { "" } } */ /* { dg-skip-if "too much code for pdp11" { "pdp11-*-*" } { "*" } { "" } } */ -/* { dg-xfail-if "jump beyond 128K not supported" { xtensa*-*-* } { "-O0" } { "" } } */ /* { dg-xfail-if "PR36698" { spu-*-* } { "-O0" } { "" } } */ /* { dg-skip-if "" { m32c-*-* } { "*" } { "" } } */ /* { dg-timeout-factor 4.0 } */ diff --git a/gcc/testsuite/gcc.c-torture/compile/pr78162.c b/gcc/testsuite/gcc.c-torture/compile/pr78162.c new file mode 100644 index 00000000000..743d4e678b5 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr78162.c @@ -0,0 +1,10 @@ +/* PR tree-optimization/78162. + Handle negative offsets in store merging gracefully. */ + +int a, b[1][2]; + +void fn1() +{ + for (a = 0; a < 2; a++) + b[-1][a] = 0; +} diff --git a/gcc/testsuite/gcc.c-torture/execute/pr78170.c b/gcc/testsuite/gcc.c-torture/execute/pr78170.c new file mode 100644 index 00000000000..dce8a3eee36 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr78170.c @@ -0,0 +1,39 @@ +/* { dg-require-effective-target int32plus } */ + +/* PR tree-optimization/78170. + Check that sign-extended store to a bitfield + doesn't overwrite other fields. */ + +int a, b, d; + +struct S0 +{ + int f0; + int f1; + int f2; + int f3; + int f4; + int f5:15; + int f6:17; + int f7:2; + int f8:30; +} c; + +void fn1 () +{ + d = b = 1; + for (; b; b = a) + { + struct S0 e = { 0, 0, 0, 0, 0, 0, 1, 0, 1 }; + c = e; + c.f6 = -1; + } +} + +int main () +{ + fn1 (); + if (c.f7 != 0) + __builtin_abort (); + return 0; +} |