public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/64426] New: Unnecessary string temporary for array assignment
@ 2014-12-28 12:35 tkoenig at gcc dot gnu.org
  2015-01-01 17:06 ` [Bug fortran/64426] " dominiq at lps dot ens.fr
  0 siblings, 1 reply; 2+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2014-12-28 12:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64426

            Bug ID: 64426
           Summary: Unnecessary string temporary for array assignment
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tkoenig at gcc dot gnu.org

After the fix for PR 56867, we now create temporaries for

program main
  character(len=4) :: a
  character(len=4) :: c(3)
  c(1) = 'abcd'
  c(2) = '1234'
  c(3) = 'wxyz'
  c(:)(1:2) = c(2)(1:2)
  c(:)(1:2) = c(2)(3:4)
  if (c(3) .ne. '23yz') call abort
end program main

bug.f90:7:14:

   c(:)(1:2) = c(2)(1:2)
              1
Warning: Creating array temporary at (1) [-Warray-temporaries]
bug.f90:8:14:

   c(:)(1:2) = c(2)(3:4)
              1
Warning: Creating array temporary at (1) [-Warray-temporaries]


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

* [Bug fortran/64426] Unnecessary string temporary for array assignment
  2014-12-28 12:35 [Bug fortran/64426] New: Unnecessary string temporary for array assignment tkoenig at gcc dot gnu.org
@ 2015-01-01 17:06 ` dominiq at lps dot ens.fr
  0 siblings, 0 replies; 2+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-01-01 17:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64426

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-01-01
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed. Note that the line

  if (c(3) .ne. '23yz') call abort

should be replaced with

  if (c(3) .ne. '34yz') call abort

I am also refraining to mark the PR as a [5 Regression]: with the above change
the code passes the test with 4.9.2.


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

end of thread, other threads:[~2015-01-01 17:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-28 12:35 [Bug fortran/64426] New: Unnecessary string temporary for array assignment tkoenig at gcc dot gnu.org
2015-01-01 17:06 ` [Bug fortran/64426] " dominiq at lps dot ens.fr

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).