re PR tree-optimization/91445 (After memset, logical && operator produces false resul...
authorRichard Biener <rguenther@suse.de>
Thu, 15 Aug 2019 12:05:31 +0000 (12:05 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 15 Aug 2019 12:05:31 +0000 (12:05 +0000)
2019-08-15  Richard Biener  <rguenther@suse.de>

PR tree-optimization/91445
* gcc.dg/torture/pr91445.c: New testcase.

From-SVN: r274533

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr91445.c [new file with mode: 0644]

index d076a7717408385b553fdd21240596854e7add58..a21600b4cc9628b16424c717ed3d6287da7de0a7 100644 (file)
@@ -1,3 +1,8 @@
+2019-08-15  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/91445
+       * gcc.dg/torture/pr91445.c: New testcase.
+
 2019-08-15  Richard Biener  <rguenther@suse.de>
 
        * 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 (file)
index 0000000..1d24d45
--- /dev/null
@@ -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;
+}