From: Jakub Jelinek Date: Wed, 30 Mar 2022 14:04:52 +0000 (+0200) Subject: testsuite: Change pr80334.C testcase to dg-do compile [PR102772] X-Git-Tag: basepoints/gcc-13~393 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a777ceb0e975f0efc823d2d82e676346f068151;p=thirdparty%2Fgcc.git 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 PR tree-optimization/80334 PR target/102772 * g++.dg/torture/pr80334.C: Change from dg-do run to dg-do compile. --- diff --git a/gcc/testsuite/g++.dg/torture/pr80334.C b/gcc/testsuite/g++.dg/torture/pr80334.C index aee154876367..d25b6777cb91 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));