public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/51041] New: g++ strange optimisation behaviour
@ 2011-11-08 22:21 fb.programming at gmail dot com
2011-11-08 22:23 ` [Bug other/51041] " fb.programming at gmail dot com
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: fb.programming at gmail dot com @ 2011-11-08 22:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51041
Bug #: 51041
Summary: g++ strange optimisation behaviour
Classification: Unclassified
Product: gcc
Version: 4.6.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: fb.programming@gmail.com
The attached code repeatedly executes a vector * vector product to test the
performance of the system. Compiled with
g++ -Wall -O2 file.cpp
it results in a performance of about 1.7 Gflops on an Intel i5-750, ie
the output is
adding: 0.059 s, 1.695 GFlops, sum=0.000000
However, when adding another printf (remove the comment in front of the
last printf) the performance deteriorates strongly (same compiler
options):
adding: 0.195 s, 0.512 GFlops, sum=0.000000
sum=0.000000
It seems the last printf confuses the compiler optimisation completely,
although it shouldn't make a difference at all, as the same variable
is already printed a few lines above.
This is worrying as it seems the compiler fails to fully optimise the
code under odd circumstances. I've used compiler version 4.6.2 as well as
4.4.1 which is the default compiler on the system.
$ gcc-4.6.2 --version
gcc-4.6.2 (GCC) 4.6.2
$ gcc --version
gcc (SUSE Linux) 4.4.1 [gcc-4_4-branch revision 150839]
$ uname -a
Linux localhost 2.6.31.14-0.8-desktop #1 SMP PREEMPT 2011-04-06 18:09:24 +0200
x86_64 x86_64 x86_64 GNU/Linux
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug other/51041] g++ strange optimisation behaviour
2011-11-08 22:21 [Bug other/51041] New: g++ strange optimisation behaviour fb.programming at gmail dot com
@ 2011-11-08 22:23 ` fb.programming at gmail dot com
2011-11-08 22:31 ` [Bug rtl-optimization/51041] " pinskia at gcc dot gnu.org
2023-07-07 15:13 ` [Bug rtl-optimization/51041] register allocation of SSE register in loop with across eh edges vmakarov at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: fb.programming at gmail dot com @ 2011-11-08 22:23 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51041
--- Comment #1 from fb.programming at gmail dot com 2011-11-08 22:20:53 UTC ---
Created attachment 25761
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25761
performance test doing vec*vec calc
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug rtl-optimization/51041] g++ strange optimisation behaviour
2011-11-08 22:21 [Bug other/51041] New: g++ strange optimisation behaviour fb.programming at gmail dot com
2011-11-08 22:23 ` [Bug other/51041] " fb.programming at gmail dot com
@ 2011-11-08 22:31 ` pinskia at gcc dot gnu.org
2023-07-07 15:13 ` [Bug rtl-optimization/51041] register allocation of SSE register in loop with across eh edges vmakarov at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-11-08 22:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51041
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization, ra
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011-11-08
Component|other |rtl-optimization
Ever Confirmed|0 |1
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-11-08 22:31:08 UTC ---
.L10:
movsd (%rbx,%rdx,8), %xmm0
mulsd 0(%rbp,%rdx,8), %xmm0
addq $1, %rdx
cmpq $10000, %rdx
addsd %xmm0, %xmm2
jne .L10
vs:
.L10:
movsd (%rbx,%rdx,8), %xmm0
mulsd 0(%rbp,%rdx,8), %xmm0
addq $1, %rdx
cmpq $10000, %rdx
addsd (%rsp), %xmm0
movsd %xmm0, (%rsp)
jne .L10
With -fno-exceptions I get the RA to act better again.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug rtl-optimization/51041] register allocation of SSE register in loop with across eh edges
2011-11-08 22:21 [Bug other/51041] New: g++ strange optimisation behaviour fb.programming at gmail dot com
2011-11-08 22:23 ` [Bug other/51041] " fb.programming at gmail dot com
2011-11-08 22:31 ` [Bug rtl-optimization/51041] " pinskia at gcc dot gnu.org
@ 2023-07-07 15:13 ` vmakarov at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: vmakarov at gcc dot gnu.org @ 2023-07-07 15:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51041
--- Comment #4 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
I believe it is the same problem as PR110215 which was solved recently by
checking whether pseudo values are used in the exception handler and the
handler does not return control flow back to the function code.
So I guess this problem was solved too.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-07-07 15:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-08 22:21 [Bug other/51041] New: g++ strange optimisation behaviour fb.programming at gmail dot com
2011-11-08 22:23 ` [Bug other/51041] " fb.programming at gmail dot com
2011-11-08 22:31 ` [Bug rtl-optimization/51041] " pinskia at gcc dot gnu.org
2023-07-07 15:13 ` [Bug rtl-optimization/51041] register allocation of SSE register in loop with across eh edges vmakarov at gcc dot gnu.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).