From a4ba1151df84ff4ae226b8d3ca8d02e982f152d5 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Sun, 13 Nov 2016 19:31:17 +0100 Subject: [PATCH] re PR rtl-optimization/78232 (FAIL: gcc.dg/torture/pr48124-4.c) PR rtl-optimization/78232 PR rtl-optimization/78248 * gcc.dg/ubsan/pr78248.c: New test. From-SVN: r242362 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.dg/ubsan/pr78248.c | 31 ++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/ubsan/pr78248.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0ae7b97cd57..58d86392b41 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-11-13 Uros Bizjak + + PR rtl-optimization/78232 + PR rtl-optimization/78248 + * gcc.dg/ubsan/pr78248.c: New test. + 2016-11-13 Eric Botcazou * gnat.dg/address_conv.adb: New test. diff --git a/gcc/testsuite/gcc.dg/ubsan/pr78248.c b/gcc/testsuite/gcc.dg/ubsan/pr78248.c new file mode 100644 index 00000000000..3483c774735 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ubsan/pr78248.c @@ -0,0 +1,31 @@ +/* PR rtl-optimization/78232 */ +/* PR rtl-optimization/78248 */ +/* { dg-do run } */ +/* { dg-options "-fsanitize=undefined" } */ + +static struct S +{ + int f0:15; +} a; + +int b[1], c = 2, d, e, f, g; + +int main () +{ + struct S h = { -2 }; + for (; e < 640; e++) + for (; f < 1; f++) + { + if (c < 2) + { + d = b[e]; + h = a; + } + g = c; + c = 1; + if (!h.f0) + break; + c = g; + } + return 0; +} -- 2.30.2