* [Bug c++/11680] member access of C++ class with all methods inline should be optimized better
2003-07-27 5:13 [Bug c++/11680] New: member access of C++ class with all methods inline should be optimized better dbaron at dbaron dot org
@ 2003-07-27 5:16 ` dbaron at dbaron dot org
2003-07-27 5:31 ` [Bug optimization/11680] " pinskia at physics dot uc dot edu
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: dbaron at dbaron dot org @ 2003-07-27 5:16 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11680
------- Additional Comments From dbaron at dbaron dot org 2003-07-27 05:16 -------
Created an attachment (id=4487)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4487&action=view)
test program
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug optimization/11680] member access of C++ class with all methods inline should be optimized better
2003-07-27 5:13 [Bug c++/11680] New: member access of C++ class with all methods inline should be optimized better dbaron at dbaron dot org
2003-07-27 5:16 ` [Bug c++/11680] " dbaron at dbaron dot org
@ 2003-07-27 5:31 ` pinskia at physics dot uc dot edu
2003-07-27 5:33 ` dberlin at gcc dot gnu dot org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-27 5:31 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11680
pinskia at physics dot uc dot edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Status|UNCONFIRMED |NEW
Component|c++ |optimization
Ever Confirmed| |1
GCC build triplet|i686-pc-linux-gnu |
GCC host triplet|i686-pc-linux-gnu |
GCC target triplet|i686-pc-linux-gnu |*-*-*
Keywords| |pessimizes-code
Priority|P2 |P3
Last reconfirmed|0000-00-00 00:00:00 |2003-07-27 05:31:00
date| |
------- Additional Comments From pinskia at physics dot uc dot edu 2003-07-27 05:31 -------
I can confirm this on the mainline (20030726) on powerpc-apple-darwin6.6 on a powerpc 750.
The problem is that are large number of stores in the loop which is redudent which might be able
to fixed by store motion but are not.
On the mainline, GCC inlines the method so there is no need for always_inline any more.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug optimization/11680] member access of C++ class with all methods inline should be optimized better
2003-07-27 5:13 [Bug c++/11680] New: member access of C++ class with all methods inline should be optimized better dbaron at dbaron dot org
2003-07-27 5:16 ` [Bug c++/11680] " dbaron at dbaron dot org
2003-07-27 5:31 ` [Bug optimization/11680] " pinskia at physics dot uc dot edu
@ 2003-07-27 5:33 ` dberlin at gcc dot gnu dot org
2003-07-27 9:34 ` gdr at integrable-solutions dot net
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2003-07-27 5:33 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11680
------- Additional Comments From dberlin at gcc dot gnu dot org 2003-07-27 05:33 -------
Try the tree-ssa branch, which should and does help quite a lot for these types of problems
My numbers:
mainline:
[dberlin@dberlin dberlin]$ time ./a.out slow
real 0m3.777s
user 0m3.770s
sys 0m0.010s
[dberlin@dberlin dberlin]$ time ./a.out fast
real 0m1.065s
user 0m1.070s
sys 0m0.000s
tree-ssa:
[dberlin@dberlin dberlin]$ time ./a.out slow
real 0m1.356s
user 0m1.360s
sys 0m0.000s
[dberlin@dberlin dberlin]$ time ./a.out fast
real 0m1.120s
user 0m1.110s
sys 0m0.010s
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug optimization/11680] member access of C++ class with all methods inline should be optimized better
2003-07-27 5:13 [Bug c++/11680] New: member access of C++ class with all methods inline should be optimized better dbaron at dbaron dot org
` (2 preceding siblings ...)
2003-07-27 5:33 ` dberlin at gcc dot gnu dot org
@ 2003-07-27 9:34 ` gdr at integrable-solutions dot net
2003-08-23 1:56 ` dhazeghi at yahoo dot com
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: gdr at integrable-solutions dot net @ 2003-07-27 9:34 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11680
------- Additional Comments From gdr at integrable-solutions dot net 2003-07-27 09:34 -------
Subject: Re: New: member access of C++ class with all methods inline should be optimized better
"dbaron at dbaron dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| In particular, the code involved a large inline method that involved repeated
| use of a member variable (being used as a cursor into the output buffer being
| written). (By default, gcc didn't inline the method. This was hand-optimized
| by using |__attribute__((always_inline))|. Should I file a separate bug on
| this, or is it unlikely to be fixed?)
Please fill a bug report. GCC should implement the obvious and original
meaning of "inline". That it failed is a bug.
That one should ressort to contorsions and unspeakable syntax like
__attribute__((always_inline)) while we have the obivous syntax is
also a bug.
-- Gaby
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug optimization/11680] member access of C++ class with all methods inline should be optimized better
2003-07-27 5:13 [Bug c++/11680] New: member access of C++ class with all methods inline should be optimized better dbaron at dbaron dot org
` (3 preceding siblings ...)
2003-07-27 9:34 ` gdr at integrable-solutions dot net
@ 2003-08-23 1:56 ` dhazeghi at yahoo dot com
2003-09-08 23:01 ` dbaron at dbaron dot org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-08-23 1:56 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11680
dhazeghi at yahoo dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
GCC target triplet|*-*-* |
Target Milestone|3.4 |---
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug optimization/11680] member access of C++ class with all methods inline should be optimized better
2003-07-27 5:13 [Bug c++/11680] New: member access of C++ class with all methods inline should be optimized better dbaron at dbaron dot org
` (4 preceding siblings ...)
2003-08-23 1:56 ` dhazeghi at yahoo dot com
@ 2003-09-08 23:01 ` dbaron at dbaron dot org
2003-11-27 7:32 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: dbaron at dbaron dot org @ 2003-09-08 23:01 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11680
------- Additional Comments From dbaron at dbaron dot org 2003-09-08 23:01 -------
Re comment 3: That's good to see. However, I would think that there should be
an optimization (really application of existing optimizations to this case) that
would cause the generated code to be exactly the same. That was my hope when
filing this bug. (After all, making clearer code run slower discourages clear
code.)
Re comment 4: Filed as bug 12219.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug optimization/11680] member access of C++ class with all methods inline should be optimized better
2003-07-27 5:13 [Bug c++/11680] New: member access of C++ class with all methods inline should be optimized better dbaron at dbaron dot org
` (5 preceding siblings ...)
2003-09-08 23:01 ` dbaron at dbaron dot org
@ 2003-11-27 7:32 ` pinskia at gcc dot gnu dot org
2004-03-03 7:10 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-27 7:32 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-11-27 07:32 -------
Suspending this one as it is fixed on the tree-ssa (might even be better than quoted now).
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |SUSPENDED
Target Milestone|--- |tree-ssa
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11680
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug optimization/11680] member access of C++ class with all methods inline should be optimized better
2003-07-27 5:13 [Bug c++/11680] New: member access of C++ class with all methods inline should be optimized better dbaron at dbaron dot org
` (6 preceding siblings ...)
2003-11-27 7:32 ` pinskia at gcc dot gnu dot org
@ 2004-03-03 7:10 ` pinskia at gcc dot gnu dot org
2004-05-26 22:37 ` [Bug rtl-optimization/11680] " pinskia at gcc dot gnu dot org
2004-06-03 4:42 ` pinskia at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-03 7:10 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-03-03 07:10 -------
GCC mainline:
zhivago2:gcc/objdir_c/gcc] pinskia% time ./a.out slow
4.510u 0.000s 0:04.59 98.2% 0+0k 0+0io 0pf+0w
[zhivago2:gcc/objdir_c/gcc] pinskia% time ./a.out fast
3.560u 0.010s 0:03.91 91.3% 0+0k 0+0io 0pf+0w
[zhivago2:gcc/objdir_c/gcc] pinskia% time ./a.out original
4.010u 0.010s 0:04.42 90.9% 0+0k 0+0io 0pf+0w
TREE-SSA:
[zhivago2:gcc/objdir_c/gcc] pinskia% time ./a.out original
3.350u 0.010s 0:03.50 96.0% 0+0k 0+1io 0pf+0w
[zhivago2:gcc/objdir_c/gcc] pinskia% time ./a.out fast
3.620u 0.020s 0:04.62 78.7% 0+0k 0+0io 0pf+0w
[zhivago2:gcc/objdir_c/gcc] pinskia% time ./a.out slow
3.610u 0.000s 0:03.73 96.7% 0+0k 0+0io 0pf+0w
Either it is already fixed on the mainline or the tree-ssa needs improvements.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|SUSPENDED |NEW
Last reconfirmed|2003-07-27 05:31:00 |2004-03-03 07:10:01
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11680
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug rtl-optimization/11680] member access of C++ class with all methods inline should be optimized better
2003-07-27 5:13 [Bug c++/11680] New: member access of C++ class with all methods inline should be optimized better dbaron at dbaron dot org
` (7 preceding siblings ...)
2004-03-03 7:10 ` pinskia at gcc dot gnu dot org
@ 2004-05-26 22:37 ` pinskia at gcc dot gnu dot org
2004-06-03 4:42 ` pinskia at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-26 22:37 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.5.0 |---
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11680
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug rtl-optimization/11680] member access of C++ class with all methods inline should be optimized better
2003-07-27 5:13 [Bug c++/11680] New: member access of C++ class with all methods inline should be optimized better dbaron at dbaron dot org
` (8 preceding siblings ...)
2004-05-26 22:37 ` [Bug rtl-optimization/11680] " pinskia at gcc dot gnu dot org
@ 2004-06-03 4:42 ` pinskia at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-03 4:42 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-03 04:42 -------
This was fixed in the merging of the tree-ssa, all the asm of the different ways are exactly the same
now (and better than the 3.4.0 also).
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|--- |3.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11680
^ permalink raw reply [flat|nested] 11+ messages in thread