From 84cc60bf83e03267f5794a16b3eb83508a3196ce Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 15 Aug 2019 12:05:31 +0000 Subject: [PATCH] re PR tree-optimization/91445 (After memset, logical && operator produces false result, optimization level >=O1) 2019-08-15 Richard Biener PR tree-optimization/91445 * gcc.dg/torture/pr91445.c: New testcase. From-SVN: r274533 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/torture/pr91445.c | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/torture/pr91445.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d076a771740..a21600b4cc9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-08-15 Richard Biener + + PR tree-optimization/91445 + * gcc.dg/torture/pr91445.c: New testcase. + 2019-08-15 Richard Biener * gcc.dg/pr80170.c: Adjust to use __SIZETYPE__. diff --git a/gcc/testsuite/gcc.dg/torture/pr91445.c b/gcc/testsuite/gcc.dg/torture/pr91445.c new file mode 100644 index 00000000000..1d24d456a57 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr91445.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ + +struct S { _Bool x; }; + +void +foo (struct S *s) +{ + __builtin_memset (s, 0x11, sizeof (struct S)); + s->x = 1; +} + +int +main () +{ + struct S s; + foo (&s); + char c; + __builtin_memcpy (&c, &s.x, 1); + if (c != 1) + __builtin_abort (); + return 0; +} -- 2.30.2