summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormartynas <martynas@openbsd.org>2014-05-01 14:15:42 +0000
committermartynas <martynas@openbsd.org>2014-05-01 14:15:42 +0000
commit3ee6095e0d36ba0260edfda78c0efa2e1f1073de (patch)
tree9d94f6c72b95aaddf6dbcf16df6288a71d27d2a5
parentfixup SoC name, as it's am335x, not am334x. (diff)
downloadwireguard-openbsd-3ee6095e0d36ba0260edfda78c0efa2e1f1073de.tar.xz
wireguard-openbsd-3ee6095e0d36ba0260edfda78c0efa2e1f1073de.zip
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. OK kettenis@. Tested in snaps for a week.
-rw-r--r--gnu/gcc/gcc/config/i386/i386.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gnu/gcc/gcc/config/i386/i386.c b/gnu/gcc/gcc/config/i386/i386.c
index 5abc9432967..6fab6d81312 100644
--- a/gnu/gcc/gcc/config/i386/i386.c
+++ b/gnu/gcc/gcc/config/i386/i386.c
@@ -14051,7 +14051,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;
}