public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/24020] New: Excessive (x20) stack usage for 4.0 with -O3
@ 2005-09-22 20:15 guillaume dot melquiond at ens-lyon dot fr
  2005-09-22 20:16 ` [Bug c/24020] " guillaume dot melquiond at ens-lyon dot fr
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: guillaume dot melquiond at ens-lyon dot fr @ 2005-09-22 20:15 UTC (permalink / raw)
  To: gcc-bugs

When compiling the attached program (-std=c99 -march=i486 -O?), GCC allocates
the following stacks for the recursive function "f" (in bytes):

GCC 3.4.5 (20050821)   -O2: 16   -O3: 16
GCC 4.0.2 (20050917)   -O2: 40   -O3: 360 (!)
GCC 4.1.0 (20050904)   -O2: 28   -O3: 28

There are only 10 local int variables in the function, so the 360-byte
consumption with GCC 4.0.2 seems a bit high, with respect to the 16 bytes with
GCC 3.4.5. Especially since the code actually runs 25% slower when compiled with
4.0.2 whatever the optimization level (17% with 4.1.0).

-- 
           Summary: Excessive (x20) stack usage for 4.0 with -O3
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: guillaume dot melquiond at ens-lyon dot fr
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: i486-linux-gnu


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


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

* [Bug c/24020] Excessive (x20) stack usage for 4.0 with -O3
  2005-09-22 20:15 [Bug c/24020] New: Excessive (x20) stack usage for 4.0 with -O3 guillaume dot melquiond at ens-lyon dot fr
@ 2005-09-22 20:16 ` guillaume dot melquiond at ens-lyon dot fr
  2005-09-22 20:18 ` [Bug middle-end/24020] " pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: guillaume dot melquiond at ens-lyon dot fr @ 2005-09-22 20:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From guillaume dot melquiond at ens-lyon dot fr  2005-09-22 20:16 -------
Created an attachment (id=9793)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9793&action=view)
Testcase


-- 


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


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

* [Bug middle-end/24020] Excessive (x20) stack usage for 4.0 with -O3
  2005-09-22 20:15 [Bug c/24020] New: Excessive (x20) stack usage for 4.0 with -O3 guillaume dot melquiond at ens-lyon dot fr
  2005-09-22 20:16 ` [Bug c/24020] " guillaume dot melquiond at ens-lyon dot fr
@ 2005-09-22 20:18 ` pinskia at gcc dot gnu dot org
  2005-09-22 20:27 ` [Bug middle-end/24020] [4.0 regression] Excessive (x20) recusive inlining " pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-22 20:18 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |middle-end


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


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

* [Bug middle-end/24020] [4.0 regression] Excessive (x20) recusive inlining for 4.0 with -O3
  2005-09-22 20:15 [Bug c/24020] New: Excessive (x20) stack usage for 4.0 with -O3 guillaume dot melquiond at ens-lyon dot fr
  2005-09-22 20:16 ` [Bug c/24020] " guillaume dot melquiond at ens-lyon dot fr
  2005-09-22 20:18 ` [Bug middle-end/24020] " pinskia at gcc dot gnu dot org
@ 2005-09-22 20:27 ` pinskia at gcc dot gnu dot org
  2005-09-23 12:37 ` [Bug middle-end/24020] [4.0 regression] Excessive (x20) recusive inlining for 4.0 with -O3 and poor stack usage even without inlining hubicka at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-22 20:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-22 20:27 -------
This is just excessive recusive inlining.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org, hubicka at gcc dot gnu
                   |                            |dot org
           Keywords|                            |missed-optimization
            Summary|Excessive (x20) stack usage |[4.0 regression] Excessive
                   |for 4.0 with -O3            |(x20) recusive inlining for
                   |                            |4.0 with -O3
   Target Milestone|---                         |4.0.2


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


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

* [Bug middle-end/24020] [4.0 regression] Excessive (x20) recusive inlining for 4.0 with -O3 and poor stack usage even without inlining
  2005-09-22 20:15 [Bug c/24020] New: Excessive (x20) stack usage for 4.0 with -O3 guillaume dot melquiond at ens-lyon dot fr
                   ` (2 preceding siblings ...)
  2005-09-22 20:27 ` [Bug middle-end/24020] [4.0 regression] Excessive (x20) recusive inlining " pinskia at gcc dot gnu dot org
@ 2005-09-23 12:37 ` hubicka at gcc dot gnu dot org
  2005-09-23 12:49 ` hubicka at gcc dot gnu dot org
  2005-09-27 15:57 ` mmitchel at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2005-09-23 12:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From hubicka at gcc dot gnu dot org  2005-09-23 12:37 -------
There is no recursive inlining happening at least on 4.1 because of overall unit
growth limit is met, so we do remarkably worse compared to 3.4 anyway.
Enabling recursive inlining makes it very active.  This is side effect of last
growth model changes and I need to trottle this somehow.

Honza

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |hubicka at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
            Summary|[4.0 regression] Excessive  |[4.0 regression] Excessive
                   |(x20) recusive inlining for |(x20) recusive inlining for
                   |4.0 with -O3                |4.0 with -O3 and poor stack
                   |                            |usage even without inlining


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


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

* [Bug middle-end/24020] [4.0 regression] Excessive (x20) recusive inlining for 4.0 with -O3 and poor stack usage even without inlining
  2005-09-22 20:15 [Bug c/24020] New: Excessive (x20) stack usage for 4.0 with -O3 guillaume dot melquiond at ens-lyon dot fr
                   ` (3 preceding siblings ...)
  2005-09-23 12:37 ` [Bug middle-end/24020] [4.0 regression] Excessive (x20) recusive inlining for 4.0 with -O3 and poor stack usage even without inlining hubicka at gcc dot gnu dot org
@ 2005-09-23 12:49 ` hubicka at gcc dot gnu dot org
  2005-09-27 15:57 ` mmitchel at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2005-09-23 12:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From hubicka at gcc dot gnu dot org  2005-09-23 12:49 -------
The difference in stack usage is caused by ivopts.  -fno-ivopts reduces 4.1
stack usage to 12 bytes and 200 bytes with --param inline-unit-growth=1000000
Especially in the second case ivops should probably trottle down after some loop
nest as it makes no sense to increase number of induction variables for each of
loop of nest8.
I will look into saner recursive inlining limits too.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|hubicka at gcc dot gnu dot  |rakdver at atrey dot karlin
                   |org                         |dot mff dot cuni dot cz


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


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

* [Bug middle-end/24020] [4.0 regression] Excessive (x20) recusive inlining for 4.0 with -O3 and poor stack usage even without inlining
  2005-09-22 20:15 [Bug c/24020] New: Excessive (x20) stack usage for 4.0 with -O3 guillaume dot melquiond at ens-lyon dot fr
                   ` (4 preceding siblings ...)
  2005-09-23 12:49 ` hubicka at gcc dot gnu dot org
@ 2005-09-27 15:57 ` mmitchel at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 15:57 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.2                       |4.0.3


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


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

end of thread, other threads:[~2005-09-27 15:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-22 20:15 [Bug c/24020] New: Excessive (x20) stack usage for 4.0 with -O3 guillaume dot melquiond at ens-lyon dot fr
2005-09-22 20:16 ` [Bug c/24020] " guillaume dot melquiond at ens-lyon dot fr
2005-09-22 20:18 ` [Bug middle-end/24020] " pinskia at gcc dot gnu dot org
2005-09-22 20:27 ` [Bug middle-end/24020] [4.0 regression] Excessive (x20) recusive inlining " pinskia at gcc dot gnu dot org
2005-09-23 12:37 ` [Bug middle-end/24020] [4.0 regression] Excessive (x20) recusive inlining for 4.0 with -O3 and poor stack usage even without inlining hubicka at gcc dot gnu dot org
2005-09-23 12:49 ` hubicka at gcc dot gnu dot org
2005-09-27 15:57 ` mmitchel 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).