aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2023-03-20 12:38:43 +0100
committerJakub Jelinek <jakub@redhat.com>2023-03-20 12:38:43 +0100
commite19234f464676efea383c8ef34c61dd18f2da108 (patch)
tree12800df0314c15b2e01cfb63bfd6404b7d88798c /gcc
parent5194ad1958cbfe800357571fad68be8bc8b7d915 (diff)
downloadgcc-e19234f464676efea383c8ef34c61dd18f2da108.zip
gcc-e19234f464676efea383c8ef34c61dd18f2da108.tar.gz
gcc-e19234f464676efea383c8ef34c61dd18f2da108.tar.bz2
testsuite: Fix up 20230313.C test
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. 2023-03-20 Jakub Jelinek <jakub@redhat.com> * g++.dg/torture/20230313.C (auto_vec): Change m_data type from char to char [2 * sizeof (int)].
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.dg/torture/20230313.C2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/testsuite/g++.dg/torture/20230313.C b/gcc/testsuite/g++.dg/torture/20230313.C
index d1f3480..99887ab 100644
--- a/gcc/testsuite/g++.dg/torture/20230313.C
+++ b/gcc/testsuite/g++.dg/torture/20230313.C
@@ -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>