diff options
author | pfg <pfg@FreeBSD.org> | 2014-05-09 01:30:15 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2014-05-09 01:30:15 +0000 |
commit | f628476f62c145d69a3e70e4dd7ae4939f33086c (patch) | |
tree | 5ed908d995aea897728965382a28932d83f74959 /contrib/gcc | |
parent | f3f247f508a17f099743bb8bf03cbe0e46e34538 (diff) | |
download | FreeBSD-src-f628476f62c145d69a3e70e4dd7ae4939f33086c.zip FreeBSD-src-f628476f62c145d69a3e70e4dd7ae4939f33086c.tar.gz |
MFC r265231:
gcc: fix strict alignment.
From the OpenBSD log:
x86-64 ABI requires arrays greater than 16 bytes to be aligned to
16byte boundary. However, GCC 16-byte aligns arrays of >=16 BITS,
not BYTES.
This diff improves bug detectability for code which has local arrays
of [16 .. 127] bits: in those cases SSP will now detect even 1-byte
overflows.
Obtained from: OpenBSD (CVS rev 1.4)
Diffstat (limited to 'contrib/gcc')
-rw-r--r-- | contrib/gcc/config/i386/i386.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/gcc/config/i386/i386.c b/contrib/gcc/config/i386/i386.c index 88f2836..26528bf 100644 --- a/contrib/gcc/config/i386/i386.c +++ b/contrib/gcc/config/i386/i386.c @@ -14408,7 +14408,7 @@ ix86_local_alignment (tree type, int align) if (AGGREGATE_TYPE_P (type) && TYPE_SIZE (type) && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST - && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 16 + && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 128 || TREE_INT_CST_HIGH (TYPE_SIZE (type))) && align < 128) return 128; } |