public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Andrew Pinski <pinskia@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-9037] c++: Add testcase for this PR [PR97990]
Date: Fri, 16 Feb 2024 19:01:26 +0000 (GMT)	[thread overview]
Message-ID: <20240216190126.8A98E385803B@sourceware.org> (raw)

https://gcc.gnu.org/g:5f1438db419c9eb8901d1d1d7f98fb69082aec8e

commit r14-9037-g5f1438db419c9eb8901d1d1d7f98fb69082aec8e
Author: Andrew Pinski <quic_apinski@quicinc.com>
Date:   Fri Feb 16 10:55:43 2024 -0800

    c++: Add testcase for this PR [PR97990]
    
    This testcase was fixed by r14-5934-gf26d68d5d128c8 but we should add
    one to make sure it does not regress again.
    
    Committed as obvious after a quick test on the testcase.
    
            PR c++/97990
    
    gcc/testsuite/ChangeLog:
    
            * g++.dg/torture/vector-struct-1.C: New test.
    
    Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>

Diff:
---
 gcc/testsuite/g++.dg/torture/vector-struct-1.C | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gcc/testsuite/g++.dg/torture/vector-struct-1.C b/gcc/testsuite/g++.dg/torture/vector-struct-1.C
new file mode 100644
index 000000000000..e2747417e2d5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/vector-struct-1.C
@@ -0,0 +1,18 @@
+/* PR c++/97990 */
+/* This used to crash with lto and strict aliasing enabled as the
+   vector type variant still had TYPE_ALIAS_SET set on it. */
+
+typedef __attribute__((__vector_size__(sizeof(short)))) short TSimd;
+TSimd hh(int);
+struct y6
+{
+  TSimd VALUE;
+  ~y6();
+};
+template <class T1,class T2>
+auto f2(T1 p1, T2){
+  return hh(p1) <= 0;
+}
+void f1(){
+  f2(0, y6{});
+}

                 reply	other threads:[~2024-02-16 19:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240216190126.8A98E385803B@sourceware.org \
    --to=pinskia@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).