Bug 38115 - unneeded temp
Summary: unneeded temp
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.4.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: missed-optimization
Depends on: 36935
Blocks: 36854
  Show dependency treegraph
 
Reported: 2008-11-14 09:03 UTC by Joost VandeVondele
Modified: 2015-11-15 17:26 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-10-27 20:11:32


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joost VandeVondele 2008-11-14 09:03:10 UTC
No need for a temp here:

SUBROUTINE S1(a,i,j,k,m)
   INTEGER :: a(3,6)
   a(1:3,m)=(/i,j,k/)
END
Comment 1 Joost VandeVondele 2008-11-14 09:07:09 UTC
I guess this one is similar enough to put here as well:

SUBROUTINE S1(a,i,j,k,m)
   INTEGER :: a(3,6)
   write(6,*) ALL(a(1:3,m).EQ.(/i,j,k/))
END
Comment 2 Paul Thomas 2008-11-18 20:11:32 UTC
Another tough one, I think.

Thanks

Paul
Comment 3 Mikael Morin 2008-11-20 14:33:21 UTC
duplicate of pr36935?
Comment 4 Joost VandeVondele 2008-11-20 18:54:24 UTC
(In reply to comment #3)
> duplicate of pr36935?

similar enough to make this one depend on PR36935. I think the testcases here (certainly comment #1), are more difficult.

Comment 5 Daniel Franke 2009-01-04 00:22:21 UTC
PR33341 belongs here as well.
Comment 6 Joost VandeVondele 2011-10-27 07:06:22 UTC
4.7 still generates the temporaries. Looks like the middle end deals with this rather well for the #c0 testcase, but not #c1.
Comment 7 Thomas Koenig 2015-11-15 17:26:11 UTC
The temporary in Comment#2 is now also removed by the middle-end.

The front end still warns about this, but I think that
this is something that we can live with.

Closing as FIXED.