public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/17088] poor fortran optimisation at -O2/3
       [not found] <bug-17088-6642@http.gcc.gnu.org/bugzilla/>
@ 2006-05-02  5:01 ` jvdelisle at gcc dot gnu dot org
  2007-07-03 18:15 ` jv244 at cam dot ac dot uk
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2006-05-02  5:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from jvdelisle at gcc dot gnu dot org  2006-05-02 05:01 -------
With:
$ gfc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../main/configure --prefix=/home/jerry/gcc/usr
--enable-languages=c,fortran --disable-libmudflap
Thread model: posix
gcc version 4.2.0 20060424 (experimental)

$ gfc -O2 -march=pentium4 test-optimize.f90      <gfortran
$ ./a.out
  4.440892098500626E-016
  0.748046000000000       0.544034000000000
$ ifc -O2 test-optimize.f90                      <intel
$ ./a.out
  0.000000000000000E+000
  0.460028000000000       0.436027000000000

Still a lot of room for improvement here.  The bottom left number is time using
matmul and the right is time hardcoded.


-- 


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


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

* [Bug rtl-optimization/17088] poor fortran optimisation at -O2/3
       [not found] <bug-17088-6642@http.gcc.gnu.org/bugzilla/>
  2006-05-02  5:01 ` [Bug rtl-optimization/17088] poor fortran optimisation at -O2/3 jvdelisle at gcc dot gnu dot org
@ 2007-07-03 18:15 ` jv244 at cam dot ac dot uk
  2008-08-28 15:57 ` [Bug rtl-optimization/17088] [4.4 Regression] " jv244 at cam dot ac dot uk
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: jv244 at cam dot ac dot uk @ 2007-07-03 18:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from jv244 at cam dot ac dot uk  2007-07-03 18:15 -------
looks like current mainline is much slower than ifort (300%) on this testcase
(on core2).

> ifort -xT -O2 test.f90
> ./a.out
  0.000000000000000E+000
  0.228014000000000       0.228014000000000
> gfortran -O3 -ffast-math -ftree-vectorize -march=native test.f90
> ./a.out
  0.00000000000000
  0.684042000000000       0.280018000000000

0.584042000000000 vs 0.228014000000000 seconds


-- 


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


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

* [Bug rtl-optimization/17088] [4.4 Regression] poor fortran optimisation at -O2/3
       [not found] <bug-17088-6642@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2008-08-28 15:57 ` [Bug rtl-optimization/17088] [4.4 Regression] " jv244 at cam dot ac dot uk
@ 2008-08-28 15:57 ` jv244 at cam dot ac dot uk
  2008-08-28 16:09 ` jv244 at cam dot ac dot uk
  4 siblings, 0 replies; 10+ messages in thread
From: jv244 at cam dot ac dot uk @ 2008-08-28 15:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from jv244 at cam dot ac dot uk  2008-08-28 15:55 -------
It looks like 4.4 performs even worse than 4.3 on the attached testcase.

gfortran -ffast-math -march=native -O3 PR17088.f90
trunk: 0.52803299999999997
4.3.0: 0.49202999999999997

ifort -xhost -O2 PR17088.f90
ifort: 0.136008000000000

so trunk is somehow 4 times slower than ifort...


-- 

jv244 at cam dot ac dot uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|poor fortran optimisation at|[4.4 Regression] poor
                   |-O2/3                       |fortran optimisation at -
                   |                            |O2/3


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


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

* [Bug rtl-optimization/17088] [4.4 Regression] poor fortran optimisation at -O2/3
       [not found] <bug-17088-6642@http.gcc.gnu.org/bugzilla/>
  2006-05-02  5:01 ` [Bug rtl-optimization/17088] poor fortran optimisation at -O2/3 jvdelisle at gcc dot gnu dot org
  2007-07-03 18:15 ` jv244 at cam dot ac dot uk
@ 2008-08-28 15:57 ` jv244 at cam dot ac dot uk
  2008-08-28 15:57 ` jv244 at cam dot ac dot uk
  2008-08-28 16:09 ` jv244 at cam dot ac dot uk
  4 siblings, 0 replies; 10+ messages in thread
From: jv244 at cam dot ac dot uk @ 2008-08-28 15:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from jv244 at cam dot ac dot uk  2008-08-28 15:56 -------
Created an attachment (id=16158)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16158&action=view)
ifort asm

ifort asm as a reference


-- 


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


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

* [Bug rtl-optimization/17088] [4.4 Regression] poor fortran optimisation at -O2/3
       [not found] <bug-17088-6642@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2008-08-28 15:57 ` jv244 at cam dot ac dot uk
@ 2008-08-28 16:09 ` jv244 at cam dot ac dot uk
  4 siblings, 0 replies; 10+ messages in thread
From: jv244 at cam dot ac dot uk @ 2008-08-28 16:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from jv244 at cam dot ac dot uk  2008-08-28 16:08 -------
actually, I've been misreading the numbers... the timings for the library
function   (MATMUL) is bad, not the generated code, which is reasonable also
with gfortran. I'll close the bug.


-- 

jv244 at cam dot ac dot uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug rtl-optimization/17088] poor fortran optimisation at -O2/3
  2004-08-18 20:47 [Bug rtl-optimization/17088] New: poor optimisation at -O2/3 and -fnew-ra jv244 at cam dot ac dot uk
                   ` (3 preceding siblings ...)
  2005-01-17 15:33 ` pinskia at gcc dot gnu dot org
@ 2005-04-07  7:25 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-07  7:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-07 07:24 -------
This seems to be fixed on the mainline at least for me:
gold:~>gfortran -O1 t.f90 
gold:~>!./
./a.out ; ./a.out ; ./a.out
  2.220446049250313E-016
   1.62675300000000       0.990850000000000     
  2.220446049250313E-016
   1.57976000000000        1.00884700000000     
  2.220446049250313E-016
   1.64775000000000       0.999848000000000     
gold:~>gfortran -O2 t.f90
gold:~>!./
./a.out ; ./a.out ; ./a.out
  4.440892098500626E-016
   1.49477200000000       0.722890000000000     
  4.440892098500626E-016
   1.53276600000000       0.716892000000000     
  4.440892098500626E-016
   1.53476700000000       0.707892000000000     
gold:~>gfortran -O3 t.f90
gold:~>!./
./a.out ; ./a.out ; ./a.out
  4.440892098500626E-016
   1.51277000000000       0.784881000000000     
  4.440892098500626E-016
   1.52476900000000       0.722890000000000     
  4.440892098500626E-016
   1.54276600000000       0.710892000000000  

Though MATMUL should be able to improved still.

-- 


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


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

* [Bug rtl-optimization/17088] poor fortran optimisation at -O2/3
  2004-08-18 20:47 [Bug rtl-optimization/17088] New: poor optimisation at -O2/3 and -fnew-ra jv244 at cam dot ac dot uk
                   ` (2 preceding siblings ...)
  2005-01-06 21:39 ` pinskia at gcc dot gnu dot org
@ 2005-01-17 15:33 ` pinskia at gcc dot gnu dot org
  2005-04-07  7:25 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-17 15:33 UTC (permalink / raw)
  To: gcc-bugs



-- 
Bug 17088 depends on bug 13246, which changed state.

Bug 13246 Summary: [new-ra][meta-bug] new-ra related problems
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13246

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|SUSPENDED                   |RESOLVED
         Resolution|                            |WONTFIX

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


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

* [Bug rtl-optimization/17088] poor fortran optimisation at -O2/3
  2004-08-18 20:47 [Bug rtl-optimization/17088] New: poor optimisation at -O2/3 and -fnew-ra jv244 at cam dot ac dot uk
  2005-01-03 12:20 ` [Bug rtl-optimization/17088] poor fortran optimisation at -O2/3 steven at gcc dot gnu dot org
  2005-01-06 21:30 ` jv244 at cam dot ac dot uk
@ 2005-01-06 21:39 ` pinskia at gcc dot gnu dot org
  2005-01-17 15:33 ` pinskia at gcc dot gnu dot org
  2005-04-07  7:25 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-06 21:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-06 21:39 -------
Looks like to me the register allocator is f'ing up as on PPC (where there more fp registers) -O2 is faster 
(by a factor of 2) than -O1.  It is also one of the reasons why new-ra could be fucking up too.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
 GCC target triplet|                            |i686-pc-linux-gnu


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


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

* [Bug rtl-optimization/17088] poor fortran optimisation at -O2/3
  2004-08-18 20:47 [Bug rtl-optimization/17088] New: poor optimisation at -O2/3 and -fnew-ra jv244 at cam dot ac dot uk
  2005-01-03 12:20 ` [Bug rtl-optimization/17088] poor fortran optimisation at -O2/3 steven at gcc dot gnu dot org
@ 2005-01-06 21:30 ` jv244 at cam dot ac dot uk
  2005-01-06 21:39 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: jv244 at cam dot ac dot uk @ 2005-01-06 21:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jv244 at cam dot ac dot uk  2005-01-06 21:30 -------
(In reply to comment #8)
> On closer inspection this is not a new-ra bug, sorry Joost.
> Can you see how the numbers look for you today?  Don't use new-ra, it is
> known to be very, very broken.

timings for -O1 and -O2 are still unchanged for a recent version of gfortran, 
i.e. -O2 is half the speed of -O1


-- 


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


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

* [Bug rtl-optimization/17088] poor fortran optimisation at -O2/3
  2004-08-18 20:47 [Bug rtl-optimization/17088] New: poor optimisation at -O2/3 and -fnew-ra jv244 at cam dot ac dot uk
@ 2005-01-03 12:20 ` steven at gcc dot gnu dot org
  2005-01-06 21:30 ` jv244 at cam dot ac dot uk
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-01-03 12:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2005-01-03 12:17 -------
On closer inspection this is not a new-ra bug, sorry Joost.

Can you see how the numbers look for you today?  Don't use new-ra, it is
known to be very, very broken.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|SUSPENDED                   |NEW
   Last reconfirmed|2004-08-19 19:29:36         |2005-01-03 12:17:45
               date|                            |
            Summary|[new-ra] poor optimisation  |poor fortran optimisation at
                   |at -O2/3 and -fnew-ra       |-O2/3


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


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

end of thread, other threads:[~2008-08-28 16:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-17088-6642@http.gcc.gnu.org/bugzilla/>
2006-05-02  5:01 ` [Bug rtl-optimization/17088] poor fortran optimisation at -O2/3 jvdelisle at gcc dot gnu dot org
2007-07-03 18:15 ` jv244 at cam dot ac dot uk
2008-08-28 15:57 ` [Bug rtl-optimization/17088] [4.4 Regression] " jv244 at cam dot ac dot uk
2008-08-28 15:57 ` jv244 at cam dot ac dot uk
2008-08-28 16:09 ` jv244 at cam dot ac dot uk
2004-08-18 20:47 [Bug rtl-optimization/17088] New: poor optimisation at -O2/3 and -fnew-ra jv244 at cam dot ac dot uk
2005-01-03 12:20 ` [Bug rtl-optimization/17088] poor fortran optimisation at -O2/3 steven at gcc dot gnu dot org
2005-01-06 21:30 ` jv244 at cam dot ac dot uk
2005-01-06 21:39 ` pinskia at gcc dot gnu dot org
2005-01-17 15:33 ` pinskia at gcc dot gnu dot org
2005-04-07  7:25 ` pinskia 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).