public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Jason Merrill <jason@redhat.com>
Cc: gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: C++ PATCH for c++/68703 (dependent vector length)
Date: Tue, 09 Aug 2016 22:11:00 -0000	[thread overview]
Message-ID: <20160809221129.GD14857@tucnak.redhat.com> (raw)
In-Reply-To: <CADzB+2kwNtRA29WBKHB0GP=x62u62_vM4p6Wc531pguS_ASATA@mail.gmail.com>

On Tue, Aug 09, 2016 at 06:02:45PM -0400, Jason Merrill wrote:
> diff --git a/gcc/testsuite/g++.dg/ext/vector32.C b/gcc/testsuite/g++.dg/ext/vector32.C
> new file mode 100644
> index 0000000..8901d0b
> --- /dev/null
> +++ b/gcc/testsuite/g++.dg/ext/vector32.C
> @@ -0,0 +1,18 @@
> +// PR c++/68703
> +
> +template <int N>
> +struct D {
> +  int v __attribute__((vector_size (N * sizeof (int))));
> +  int f1 () { return this->v[N-1]; }
> +  int f2 () { return v[N-1]; }
> +};
> +
> +int
> +main ()
> +{
> +  D<4> a = { { 0, 1, 2, 3 } };
> +  D<8> b = { { 0, 1, 2, 3, 4, 5, 6, 7 } };
> +  if (a.f1 () != 3 || a.f2 () != 3
> +      || b.f1 () != 7 || b.f2 () != 7)
> +    __builtin_abort ();
> +}
> diff --git a/gcc/testsuite/g++.dg/ext/vector32a.C b/gcc/testsuite/g++.dg/ext/vector32a.C
> new file mode 100644
> index 0000000..8901d0b
> --- /dev/null
> +++ b/gcc/testsuite/g++.dg/ext/vector32a.C

This test is the same as the other one.  Did you mean to use
  typedef int V __attribute__((vector_size (N * sizeof (int))));
  V v;
instead or something similar (where the attribute would live on
the type rather than on the FIELD_DECL?

	Jakub

  reply	other threads:[~2016-08-09 22:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09 22:03 Jason Merrill
2016-08-09 22:11 ` Jakub Jelinek [this message]
2016-08-10  2:27   ` Jason Merrill
2016-09-28 18:55 David Edelsohn
2016-09-29 18:14 ` Jason Merrill

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=20160809221129.GD14857@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    /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).