public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/38111] unneeded temporary
       [not found] <bug-38111-4@http.gcc.gnu.org/bugzilla/>
@ 2013-08-09  8:22 ` tkoenig at gcc dot gnu.org
  0 siblings, 0 replies; 5+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2013-08-09  8:22 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tkoenig at gcc dot gnu.org

--- Comment #5 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
One way of handling this would be to create a DO loop
from the array assignment.

Of course, we would have to make sure check for dependencies,
for example

a = [(a(4)+3,i=1,n)]


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

* [Bug fortran/38111] unneeded temporary
  2008-11-14  8:44 [Bug fortran/38111] New: " jv244 at cam dot ac dot uk
                   ` (2 preceding siblings ...)
  2010-04-27 18:08 ` jv244 at cam dot ac dot uk
@ 2010-05-09 20:49 ` dfranke at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-09 20:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dfranke at gcc dot gnu dot org  2010-05-09 20:49 -------
Enhancement only - and probably a dupe of PR33341?!


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org
           Severity|normal                      |enhancement


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


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

* [Bug fortran/38111] unneeded temporary
  2008-11-14  8:44 [Bug fortran/38111] New: " jv244 at cam dot ac dot uk
  2008-11-18 19:58 ` [Bug fortran/38111] " pault at gcc dot gnu dot org
  2008-11-19 13:19 ` jv244 at cam dot ac dot uk
@ 2010-04-27 18:08 ` jv244 at cam dot ac dot uk
  2010-05-09 20:49 ` dfranke at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jv244 at cam dot ac dot uk @ 2010-04-27 18:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jv244 at cam dot ac dot uk  2010-04-27 18:07 -------
still fails with current trunk.


-- 

jv244 at cam dot ac dot uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.6.0


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


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

* [Bug fortran/38111] unneeded temporary
  2008-11-14  8:44 [Bug fortran/38111] New: " jv244 at cam dot ac dot uk
  2008-11-18 19:58 ` [Bug fortran/38111] " pault at gcc dot gnu dot org
@ 2008-11-19 13:19 ` jv244 at cam dot ac dot uk
  2010-04-27 18:08 ` jv244 at cam dot ac dot uk
  2010-05-09 20:49 ` dfranke at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jv244 at cam dot ac dot uk @ 2008-11-19 13:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jv244 at cam dot ac dot uk  2008-11-19 13:18 -------
(In reply to comment #1)
> Do you know of any compilers that catch this?  As you say, it is not so easy to
> fix.

I believe ifort gets this right (compiled with 'ifort -S -heap-arrays 64), but
this is just looking at the assembly, which normally contains calls to
for_allocate if a temp is generated:

s1_:
# parameter 1: %rdi
..B1.1:                         # Preds ..B1.0
..___tag_value_s1_.1:                                           #1.12
        movq      48(%rdi), %rsi                                #4.1
        movl      $1, %r8d                                      #4.1
        testq     %rsi, %rsi                                    #4.1
        jle       ..B1.5        # Prob 10%                      #4.1
                                # LOE rbx rbp rsi rdi r8 r12 r13 r14 r15
..B1.2:                         # Preds ..B1.1
        movq      (%rdi), %rax                                  #4.1
        movq      56(%rdi), %rcx                                #4.1
        movq      %rcx, %rdx                                    #4.1
        subq      %rcx, %rax                                    #
                                # LOE rax rdx rcx rbx rbp rsi r8 r12 r13 r14
r15
..B1.3:                         # Preds ..B1.3 ..B1.2
        movl      %r8d, (%rdx,%rax)                             #4.1
        addq      %rcx, %rdx                                    #4.1
        addq      $1, %r8                                       #4.1
        cmpq      %rsi, %r8                                     #4.1
        jle       ..B1.3        # Prob 82%                      #4.1
                                # LOE rax rdx rcx rbx rbp rsi r8 r12 r13 r14
r15
..B1.5:                         # Preds ..B1.3 ..B1.1
        ret                                                     #5.1
        .align    2,0x90


> 
> BTW you say that this another case where an unneeded temp is created.  I can
> see your PRs after this.  Which ones come before?

I've added a number of these as blocking PR36854. As mentioned before, all
derived from CP2K. I believe these are relatively important to fix, the
performance inpact of generating an unneeded temp can be very large.

Joost

> 
> Paul
> 


-- 


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


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

* [Bug fortran/38111] unneeded temporary
  2008-11-14  8:44 [Bug fortran/38111] New: " jv244 at cam dot ac dot uk
@ 2008-11-18 19:58 ` pault at gcc dot gnu dot org
  2008-11-19 13:19 ` jv244 at cam dot ac dot uk
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-11-18 19:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pault at gcc dot gnu dot org  2008-11-18 19:57 -------
Joost,

Do you know of any compilers that catch this?  As you say, it is not so easy to
fix.

BTW you say that this another case where an unneeded temp is created.  I can
see your PRs after this.  Which ones come before?

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-11-18 19:57:17
               date|                            |


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


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

end of thread, other threads:[~2013-08-09  8:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-38111-4@http.gcc.gnu.org/bugzilla/>
2013-08-09  8:22 ` [Bug fortran/38111] unneeded temporary tkoenig at gcc dot gnu.org
2008-11-14  8:44 [Bug fortran/38111] New: " jv244 at cam dot ac dot uk
2008-11-18 19:58 ` [Bug fortran/38111] " pault at gcc dot gnu dot org
2008-11-19 13:19 ` jv244 at cam dot ac dot uk
2010-04-27 18:08 ` jv244 at cam dot ac dot uk
2010-05-09 20:49 ` dfranke 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).