public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-7920] testsuite: Change pr80334.C testcase to dg-do compile [PR102772]
@ 2022-03-30 14:06 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2022-03-30 14:06 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:6a777ceb0e975f0efc823d2d82e676346f068151

commit r12-7920-g6a777ceb0e975f0efc823d2d82e676346f068151
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Mar 30 16:04:52 2022 +0200

    testsuite: Change pr80334.C testcase to dg-do compile [PR102772]
    
    The testcase has UB at runtime, placement new shouldn't construct
    an object with certain alignment requirements into an unaligned buffer.
    
    2022-03-30  Jakub Jelinek  <jakub@redhat.com>
    
            PR tree-optimization/80334
            PR target/102772
            * g++.dg/torture/pr80334.C: Change from dg-do run to dg-do compile.

Diff:
---
 gcc/testsuite/g++.dg/torture/pr80334.C | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/g++.dg/torture/pr80334.C b/gcc/testsuite/g++.dg/torture/pr80334.C
index aee15487636..d25b6777cb9 100644
--- a/gcc/testsuite/g++.dg/torture/pr80334.C
+++ b/gcc/testsuite/g++.dg/torture/pr80334.C
@@ -1,4 +1,8 @@
-// { dg-do run }
+// This used to be dg-do run testcase, but it is invalid at runtime:
+// trying to do a placement new of A which is 16-byte sized and aligned
+// into a 16-byte buffer at offset 17 bytes from 16-byte aligned address
+// is UB.
+// { dg-do compile }
 
 struct A { alignas(16) char c; };
 struct B { A unpacked; char d; } __attribute__((packed));


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-30 14:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30 14:06 [gcc r12-7920] testsuite: Change pr80334.C testcase to dg-do compile [PR102772] Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).