diff options
author | Matthew Dempsky <matthew@cvs.openbsd.org> | 2014-06-23 20:31:20 +0000 |
---|---|---|
committer | Matthew Dempsky <matthew@cvs.openbsd.org> | 2014-06-23 20:31:20 +0000 |
commit | fcbe57390cb4032ca29203a99f2733f35c9d41cb (patch) | |
tree | 1be88d2a462370bc0b87942cb8668e0ca3144b70 /gnu/gcc | |
parent | fa788535af87a0de0c56b978494a7935ac8e5edf (diff) |
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
Diffstat (limited to 'gnu/gcc')
-rw-r--r-- | gnu/gcc/gcc/cfgexpand.c | 5 |
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; |