From: Richard Biener <rguenther@suse.de>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] New testcase
Date: Mon, 20 Mar 2023 10:59:57 +0000 (UTC) [thread overview]
Message-ID: <nycvar.YFH.7.77.849.2303201059460.18795@jbgna.fhfr.qr> (raw)
In-Reply-To: <ZBgyRKFDWHiF2HA+@tucnak>
On Mon, 20 Mar 2023, Jakub Jelinek wrote:
> On Tue, Mar 14, 2023 at 07:29:19AM +0000, Richard Biener via Gcc-patches wrote:
> > This is a reduced testcase for an issue I ran into when trying to
> > improve PTA compile-time further, there wasn't any C family runfail
> > in the testsuite for this.
> >
> > Pushed.
> >
> > * g++.dg/torture/20230313.C: New testcase.
>
> I've noticed this testcase FAILs on i686-linux with
> -fstack-protector-strong.
>
> sizeof (auto_vec<int, 8>) == 16, which in this case contains
> 4-byte m_vec (which points to to m_auto), then 8-byte m_auto
> which contains just 8-byte m_vecpfx and finally 1 byte m_data,
> rest is padding. We then try to push 2 ints to it, so 8 bytes,
> starting at the end of m_vecpfx aka address of m_data, but there
> is just 1 byte + 3 bytes of padding.
> In the lp64 case, I think sizeof (auto_vec<int, 8>) == 24,
> because there is 8-byte m_vec, 8-byte m_vecpfx and 1-byte m_char
> all with 8-byte alignment.
>
> Can we just change
> --- gcc/testsuite/g++.dg/torture/20230313.C.jj 2023-03-14 12:24:55.930723588 +0100
> +++ gcc/testsuite/g++.dg/torture/20230313.C 2023-03-20 11:11:55.009044518 +0100
> @@ -60,7 +60,7 @@ struct auto_vec : vec<T, va_heap>
> this->release ();
> }
> vec<T, va_heap, int> m_auto;
> - char m_data;
> + char m_data[2 * sizeof (int)];
> };
> template<typename T>
> struct vec<T, va_heap>
>
> or does it go against what the testcase wants to verify?
That should be fine.
Thanks,
Richard.
next prev parent reply other threads:[~2023-03-20 10:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230314072924.C1A34385840C@sourceware.org>
2023-03-20 10:15 ` Jakub Jelinek
2023-03-20 10:59 ` Richard Biener [this message]
2023-03-14 7:29 Richard Biener
-- strict thread matches above, loose matches on Subject: below --
2012-06-15 11:43 Richard Guenther
2009-10-20 16:00 Richard Guenther
2008-05-22 16:55 Richard Guenther
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=nycvar.YFH.7.77.849.2303201059460.18795@jbgna.fhfr.qr \
--to=rguenther@suse.de \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@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).