public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug regression/34548]  New: GCC generates too many alignment adds for alloca
@ 2007-12-21 17:20 aoliva at gcc dot gnu dot org
  2008-07-04 23:54 ` [Bug middle-end/34548] " jsm28 at gcc dot gnu dot org
  0 siblings, 1 reply; 6+ messages in thread
From: aoliva at gcc dot gnu dot org @ 2007-12-21 17:20 UTC (permalink / raw)
  To: gcc-bugs

WRT http://gbenson.livejournal.com/2007/12/21/

GCC is being overzealous because of a default that was local to one file was
made global on 2003-10-07, and this changed the behavior of the #if statement
in explow.c's allocate_dynamic_stack_space():

#if defined (STACK_DYNAMIC_OFFSET) || defined (STACK_POINTER_OFFSET)
#define MUST_ALIGN 1
#else
#define MUST_ALIGN (PREFERRED_STACK_BOUNDARY < BIGGEST_ALIGNMENT)
#endif

Unfortunately, STACK_POINTER_OFFSET isn't a preprocessor constant on all ports.
 We could change the above to:

#if defined (STACK_DYNAMIC_OFFSET)
#define MUST_ALIGN 1
#else
#define MUST_ALIGN (STACK_POINTER_OFFSET || PREFERRED_STACK_BOUNDARY <
BIGGEST_ALIGNMENT)
#endif

but on at least one port (pa), STACK_POINTER_OFFSET depends on the size of the
outgoing arguments of a function, which we don't necessarily know yet at the
point we expand alloca builtins.  For pa, it's never zero, but for other ports
it might be, and then this would break.

BTW, function.c still provides a no-longer-necessary default for
STACK_POINTER_OFFSET.


-- 
           Summary: GCC generates too many alignment adds for alloca
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: regression
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: aoliva at gcc dot gnu dot org


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


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

end of thread, other threads:[~2012-11-29 21:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-34548-4@http.gcc.gnu.org/bugzilla/>
2012-07-27 18:14 ` [Bug middle-end/34548] GCC generates too many alignment adds for alloca rth at gcc dot gnu.org
2012-07-30  9:34 ` ebotcazou at gcc dot gnu.org
2012-07-30  9:35 ` ebotcazou at gcc dot gnu.org
2012-08-01 20:41 ` rth at gcc dot gnu.org
2012-11-29 21:21 ` rth at gcc dot gnu.org
2007-12-21 17:20 [Bug regression/34548] New: " aoliva at gcc dot gnu dot org
2008-07-04 23:54 ` [Bug middle-end/34548] " jsm28 at gcc dot gnu dot org

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).