public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/44542]  New: expand_one_stack_var_at may set DECL_ALIGN to a too high value
@ 2010-06-15 10:51 jakub at gcc dot gnu dot org
  2010-06-15 11:19 ` [Bug target/44542] " matz at gcc dot gnu dot org
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-06-15 10:51 UTC (permalink / raw)
  To: gcc-bugs

On say -O0:
void foo (long x)
{
  long a, b, c, d;
  __builtin_alloca (1);
}

some of the variables get much higher DECL_ALIGN than they in the end really
have.  I don't have a testcase which shows miscompilation on the trunk, still
it seems to be a latent bug.  IMHO it should instead set DECL_ALIGN to the
maximum of requested DECL_ALIGN and alignment from offset for minimum possible
stack alignment and only after expansion when it is finalized what stack
alignment it will have it can be increased if needed.  On 4.4-RH I've run into
another issue (perhaps also latent on the trunk) - if expand_stack_var is
called twice on the same variable, the first time it is given a stack slot and
DECL_ALIGN set to a very high number (e.g. for offset 32 it is 256 bits) and
next time the function doesn't do almost anything (DECL_RTL_SET_P is true),
except for increasing requested alignment to the given one, so it ends up
wanting to realign the stack.


-- 
           Summary: expand_one_stack_var_at may set DECL_ALIGN to a too high
                    value
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org
GCC target triplet: x86_64-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44542


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2010-09-17 20:25 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-15 10:51 [Bug target/44542] New: expand_one_stack_var_at may set DECL_ALIGN to a too high value jakub at gcc dot gnu dot org
2010-06-15 11:19 ` [Bug target/44542] " matz at gcc dot gnu dot org
2010-06-15 11:37 ` jakub at gcc dot gnu dot org
2010-06-15 12:53 ` jakub at gcc dot gnu dot org
2010-06-15 13:41 ` matz at gcc dot gnu dot org
2010-06-15 13:51 ` matz at gcc dot gnu dot org
2010-06-15 14:47 ` hjl dot tools at gmail dot com
2010-06-15 14:56 ` matz at gcc dot gnu dot org
2010-06-15 15:39 ` hjl dot tools at gmail dot com
2010-06-15 16:46 ` jakub at gcc dot gnu dot org
2010-06-15 17:13 ` hjl dot tools at gmail dot com
2010-06-15 17:20 ` hjl dot tools at gmail dot com
2010-06-15 17:25 ` hjl dot tools at gmail dot com
2010-06-16  6:56 ` jakub at gcc dot gnu dot org
2010-06-16 14:36 ` hjl dot tools at gmail dot com
2010-06-16 14:58 ` jakub at gcc dot gnu dot org
2010-06-16 15:38 ` hjl dot tools at gmail dot com
2010-07-27 17:55 ` jakub at gcc dot gnu dot org
2010-07-27 18:00 ` jakub at gcc dot gnu dot org
2010-09-17 20:25 ` hjl dot tools at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).