summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatthew <matthew@openbsd.org>2014-06-23 20:31:19 +0000
committermatthew <matthew@openbsd.org>2014-06-23 20:31:19 +0000
commita88594640d46abd0828dd945f3bd69ca89f5614b (patch)
tree6378e6140b77a49fd4de8bf42bcdcb294e50db21
parentfirst attempt at documenting NOINET6 by default and eui64 turning it on again (diff)
downloadwireguard-openbsd-a88594640d46abd0828dd945f3bd69ca89f5614b.tar.xz
wireguard-openbsd-a88594640d46abd0828dd945f3bd69ca89f5614b.zip
gcc4: emit warning when ignoring alignment constraints
Currently, GCC 4.2 silently ignores the "aligned" attribute for objects allocated on the stack if the specified minimum alignment exceeds the platform's natural stack alignment. This has bitten us in the past, so we shouldn't allow this to continue. Fixing the "ignores" problem seems hard, so this commit settles for tackling the "silently" problem instead. ok miod, and possibly guenther and deraadt
-rw-r--r--gnu/gcc/gcc/cfgexpand.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gnu/gcc/gcc/cfgexpand.c b/gnu/gcc/gcc/cfgexpand.c
index abdbe66d10d..d69855dbeb6 100644
--- a/gnu/gcc/gcc/cfgexpand.c
+++ b/gnu/gcc/gcc/cfgexpand.c
@@ -160,7 +160,10 @@ get_decl_align_unit (tree decl)
align = DECL_ALIGN (decl);
align = LOCAL_ALIGNMENT (TREE_TYPE (decl), align);
if (align > PREFERRED_STACK_BOUNDARY)
- align = PREFERRED_STACK_BOUNDARY;
+ {
+ warning (0, "ignoring alignment for stack allocated %q+D", decl);
+ align = PREFERRED_STACK_BOUNDARY;
+ }
if (cfun->stack_alignment_needed < align)
cfun->stack_alignment_needed = align;