public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/33341]  New: unnecessary stores for array constructor
@ 2007-09-07 20:17 tkoenig at gcc dot gnu dot org
  2007-09-07 21:05 ` [Bug fortran/33341] " tkoenig at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-09-07 20:17 UTC (permalink / raw)
  To: gcc-bugs

The following idiom causes unnecessary runtime
overhead:

$ cat compare.f90
function foo(a,b,c,d)
  logical :: foo
  integer, intent(in):: a,b,c,d

  foo = all((/ a, b, c /) /= d)
end function foo
$ gfortran -fdump-tree-optimized -O3 -S compare.f90

The *.optimized file shows

<bb 2>:
  D.521 = (int4[0:] *) &A.2;
  D.522 = *a;
  (*D.521)[0] = D.522;
  D.523 = *b;
  (*D.521)[1] = D.523;
  D.524 = *c;
  (*D.521)[2] = D.524;
  D.516 = *d;

The stores are unneeded, as the array itself could
be eliminated.


-- 
           Summary: unnecessary stores for array constructor
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 10+ messages in thread
[parent not found: <bug-33341-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2013-01-31 21:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-07 20:17 [Bug fortran/33341] New: unnecessary stores for array constructor tkoenig at gcc dot gnu dot org
2007-09-07 21:05 ` [Bug fortran/33341] " tkoenig at gcc dot gnu dot org
2007-09-08 11:32 ` tkoenig at gcc dot gnu dot org
2007-10-01 13:15 ` fxcoudert at gcc dot gnu dot org
2008-07-27 19:29 ` [Bug fortran/33341] array temporaries for "all intrinsic" (unnecessary stores for array constructor) tkoenig at gcc dot gnu dot org
2009-01-03 21:42 ` [Bug fortran/33341] array temporaries for array constructors (unnecessary stores) dfranke at gcc dot gnu dot org
2009-01-04  0:21 ` dfranke at gcc dot gnu dot org
2010-05-09 18:31 ` dfranke at gcc dot gnu dot org
2010-06-09 20:58 ` dominiq at lps dot ens dot fr
     [not found] <bug-33341-4@http.gcc.gnu.org/bugzilla/>
2013-01-31 21:02 ` tkoenig 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).