From: Richard Biener Date: Thu, 15 Aug 2019 12:05:31 +0000 (+0000) Subject: re PR tree-optimization/91445 (After memset, logical && operator produces false resul... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=84cc60bf83e03267f5794a16b3eb83508a3196ce;p=gcc.git 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 --- 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; +}