public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/45648]  New: [4.6 regression] Unnecessary temporary for transpose calls as actual argument.
@ 2010-09-11 10:07 mikael at gcc dot gnu dot org
  2010-09-11 10:07 ` [Bug fortran/45648] " mikael at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: mikael at gcc dot gnu dot org @ 2010-09-11 10:07 UTC (permalink / raw)
  To: gcc-bugs

As explained at http://gcc.gnu.org/ml/fortran/2010-09/msg00120.html the
transpose change committed at
http://gcc.gnu.org/viewcvs?view=revision&revision=164205 introduces unnecessary
temporaries for transpose calls as actual argument.


-- 
           Summary: [4.6 regression] Unnecessary temporary for transpose
                    calls as actual argument.
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mikael at gcc dot gnu dot org


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


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

* [Bug fortran/45648] [4.6 regression] Unnecessary temporary for transpose calls as actual argument.
  2010-09-11 10:07 [Bug fortran/45648] New: [4.6 regression] Unnecessary temporary for transpose calls as actual argument mikael at gcc dot gnu dot org
@ 2010-09-11 10:07 ` mikael at gcc dot gnu dot org
  2010-09-11 16:33 ` mikael at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu dot org @ 2010-09-11 10:07 UTC (permalink / raw)
  To: gcc-bugs



-- 

mikael at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mikael at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-09-11 10:07:39
               date|                            |
            Summary|[4.6 regression] Unnecessary|[4.6 regression] Unnecessary
                   |temporary for transpose     |temporary for transpose
                   |calls as actual argument.   |calls as actual argument.
   Target Milestone|---                         |4.6.0


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


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

* [Bug fortran/45648] [4.6 regression] Unnecessary temporary for transpose calls as actual argument.
  2010-09-11 10:07 [Bug fortran/45648] New: [4.6 regression] Unnecessary temporary for transpose calls as actual argument mikael at gcc dot gnu dot org
  2010-09-11 10:07 ` [Bug fortran/45648] " mikael at gcc dot gnu dot org
@ 2010-09-11 16:33 ` mikael at gcc dot gnu dot org
  2010-09-11 17:02 ` mikael at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu dot org @ 2010-09-11 16:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from mikael at gcc dot gnu dot org  2010-09-11 16:32 -------
The patch where the transpose optimization appeared
http://gcc.gnu.org/ml/gcc-patches/2005-08/msg01472.html

There is a testcase there, I will probably incorporate it into the testsuite. 


-- 


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


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

* [Bug fortran/45648] [4.6 regression] Unnecessary temporary for transpose calls as actual argument.
  2010-09-11 10:07 [Bug fortran/45648] New: [4.6 regression] Unnecessary temporary for transpose calls as actual argument mikael at gcc dot gnu dot org
  2010-09-11 10:07 ` [Bug fortran/45648] " mikael at gcc dot gnu dot org
  2010-09-11 16:33 ` mikael at gcc dot gnu dot org
@ 2010-09-11 17:02 ` mikael at gcc dot gnu dot org
  2010-09-20 20:01 ` pthaugen at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu dot org @ 2010-09-11 17:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from mikael at gcc dot gnu dot org  2010-09-11 17:01 -------
Created an attachment (id=21777)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21777&action=view)
patch restoring the previous behaviour. 


-- 


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


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

* [Bug fortran/45648] [4.6 regression] Unnecessary temporary for transpose calls as actual argument.
  2010-09-11 10:07 [Bug fortran/45648] New: [4.6 regression] Unnecessary temporary for transpose calls as actual argument mikael at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-09-11 17:02 ` mikael at gcc dot gnu dot org
@ 2010-09-20 20:01 ` pthaugen at gcc dot gnu dot org
  2010-09-20 20:46 ` pthaugen at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pthaugen at gcc dot gnu dot org @ 2010-09-20 20:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pthaugen at gcc dot gnu dot org  2010-09-20 20:00 -------
As Steven mentioned in the mailing list, this did introduce a degradation for
cpu2000 benchmark galgel. I'm seeing about -10% on PowerPC.


-- 

pthaugen at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pthaugen at gcc dot gnu dot
                   |                            |org


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


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

* [Bug fortran/45648] [4.6 regression] Unnecessary temporary for transpose calls as actual argument.
  2010-09-11 10:07 [Bug fortran/45648] New: [4.6 regression] Unnecessary temporary for transpose calls as actual argument mikael at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-09-20 20:01 ` pthaugen at gcc dot gnu dot org
@ 2010-09-20 20:46 ` pthaugen at gcc dot gnu dot org
  2010-09-20 22:26 ` mikael at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pthaugen at gcc dot gnu dot org @ 2010-09-20 20:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pthaugen at gcc dot gnu dot org  2010-09-20 20:45 -------
(In reply to comment #2)
> Created an attachment (id=21777)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21777&action=view) [edit]
> patch restoring the previous behaviour. 
> 

Applying this patch restored the performance.


-- 


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


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

* [Bug fortran/45648] [4.6 regression] Unnecessary temporary for transpose calls as actual argument.
  2010-09-11 10:07 [Bug fortran/45648] New: [4.6 regression] Unnecessary temporary for transpose calls as actual argument mikael at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2010-09-20 20:46 ` pthaugen at gcc dot gnu dot org
@ 2010-09-20 22:26 ` mikael at gcc dot gnu dot org
  2010-09-20 22:29 ` mikael at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu dot org @ 2010-09-20 22:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from mikael at gcc dot gnu dot org  2010-09-20 22:26 -------
(In reply to comment #4)
> (In reply to comment #2)
> > Created an attachment (id=21777)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21777&action=view) [edit]
> > patch restoring the previous behaviour. 
> > 
> 
> Applying this patch restored the performance.
> 
Sorry, the patch is missing the 5/5 part of the patch set I have just posted at 
http://gcc.gnu.org/ml/fortran/2010-09/msg00364.html

Without it, gfortran over-optimizes function calls with transposed aliasing
arguments.  


-- 


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


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

* [Bug fortran/45648] [4.6 regression] Unnecessary temporary for transpose calls as actual argument.
  2010-09-11 10:07 [Bug fortran/45648] New: [4.6 regression] Unnecessary temporary for transpose calls as actual argument mikael at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2010-09-20 22:26 ` mikael at gcc dot gnu dot org
@ 2010-09-20 22:29 ` mikael at gcc dot gnu dot org
  2010-09-21 19:04 ` mikael at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu dot org @ 2010-09-20 22:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from mikael at gcc dot gnu dot org  2010-09-20 22:29 -------
Created an attachment (id=21853)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21853&action=view)
Updated patch

I attach the full updated patch for convenience. 


-- 

mikael at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #21777|0                           |1
        is obsolete|                            |


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


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

* [Bug fortran/45648] [4.6 regression] Unnecessary temporary for transpose calls as actual argument.
  2010-09-11 10:07 [Bug fortran/45648] New: [4.6 regression] Unnecessary temporary for transpose calls as actual argument mikael at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2010-09-20 22:29 ` mikael at gcc dot gnu dot org
@ 2010-09-21 19:04 ` mikael at gcc dot gnu dot org
  2010-09-23 11:11 ` mikael at gcc dot gnu dot org
  2010-09-23 14:14 ` mikael at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu dot org @ 2010-09-21 19:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from mikael at gcc dot gnu dot org  2010-09-21 19:04 -------
Subject: Bug 45648

Author: mikael
Date: Tue Sep 21 19:04:09 2010
New Revision: 164494

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164494
Log:
2010-09-21  Mikael Morin  <mikael@gcc.gnu.org>

        PR fortran/45648
        * trans-array.c (gfc_conv_expr_descriptor): Calculate dim out of n and
        info->dim.

        PR fortran/45648
        * trans-array.c (gfc_conv_expr_descriptor): Unset full if we are
        accessing dimensions in reversed order. 

        PR fortran/45648
        * trans-array.c (gfc_conv_expr_descriptor): Special case noncopying
        intrinsic function call. 

        * trans-array.c (gfc_conv_expr_descriptor): Remove ss lookup.
        Update asserts accordingly.

        PR fortran/45648
        * trans.h (gfc_se): New field force_tmp. 
        * trans-expr.c (gfc_conv_procedure_call): Check for argument alias
        and set parmse.force_tmp if some alias is found. 
        * trans-array.c (gfc_conv_expr_descriptor): Force a temporary creation
        if se->force_tmp is set. 

2010-09-21  Mikael Morin  <mikael@gcc.gnu.org>

        PR fortran/45648
        * gfortran.dg/inline_transpose_1.f90: Update temporary's locations
        and counts. Add non-elemental function call check.

        PR fortran/45648
        * gfortran.dg/inline_transpose_1.f90: Add function calls with aliasing
        arguments checks. Update temporary counts.
        * gfortran.dg/transpose_optimization_1.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/transpose_optimization_1.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-array.c
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/fortran/trans.h
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/inline_transpose_1.f90


-- 


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


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

* [Bug fortran/45648] [4.6 regression] Unnecessary temporary for transpose calls as actual argument.
  2010-09-11 10:07 [Bug fortran/45648] New: [4.6 regression] Unnecessary temporary for transpose calls as actual argument mikael at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2010-09-21 19:04 ` mikael at gcc dot gnu dot org
@ 2010-09-23 11:11 ` mikael at gcc dot gnu dot org
  2010-09-23 14:14 ` mikael at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu dot org @ 2010-09-23 11:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from mikael at gcc dot gnu dot org  2010-09-23 11:11 -------
Subject: Bug 45648

Author: mikael
Date: Thu Sep 23 11:11:23 2010
New Revision: 164558

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164558
Log:
2010-09-23  Mikael Morin  <mikael@gcc.gnu.org>

        PR fortran/45745
        PR fortran/45648
        * trans-array.c (gfc_conv_expr_descriptor): Handle 
        ss->type == GFC_SS_INTRINSIC (for {l,u}bound intrinsics) case. 

2010-09-23  Mikael Morin  <mikael@gcc.gnu.org>

        PR fortran/45745
        PR fortran/45648
        * gfortran.dg/vector_subscript_bound_1.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/vector_subscript_bound_1.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-array.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/45648] [4.6 regression] Unnecessary temporary for transpose calls as actual argument.
  2010-09-11 10:07 [Bug fortran/45648] New: [4.6 regression] Unnecessary temporary for transpose calls as actual argument mikael at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2010-09-23 11:11 ` mikael at gcc dot gnu dot org
@ 2010-09-23 14:14 ` mikael at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu dot org @ 2010-09-23 14:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from mikael at gcc dot gnu dot org  2010-09-23 14:13 -------
Unless something breaks again, this should be fixed now. 


-- 

mikael at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2010-09-23 14:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-11 10:07 [Bug fortran/45648] New: [4.6 regression] Unnecessary temporary for transpose calls as actual argument mikael at gcc dot gnu dot org
2010-09-11 10:07 ` [Bug fortran/45648] " mikael at gcc dot gnu dot org
2010-09-11 16:33 ` mikael at gcc dot gnu dot org
2010-09-11 17:02 ` mikael at gcc dot gnu dot org
2010-09-20 20:01 ` pthaugen at gcc dot gnu dot org
2010-09-20 20:46 ` pthaugen at gcc dot gnu dot org
2010-09-20 22:26 ` mikael at gcc dot gnu dot org
2010-09-20 22:29 ` mikael at gcc dot gnu dot org
2010-09-21 19:04 ` mikael at gcc dot gnu dot org
2010-09-23 11:11 ` mikael at gcc dot gnu dot org
2010-09-23 14:14 ` mikael 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).