public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/36915] New: Unneccessary array temporary for same_array = scalar * same_array
@ 2008-07-24 8:39 burnus at gcc dot gnu dot org
2008-07-24 10:14 ` [Bug fortran/36915] Unneccessary array temporary for same_array_ptr = const * same_array_ptr dfranke at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-07-24 8:39 UTC (permalink / raw)
To: gcc-bugs
Maybe this could be handled by the Middle End, once the array operations in the
ME are implemented. This would save us from checking the alias information in
the FE.
Regarding the "Middle-End Array Expressions", see:
http://www.gccsummit.org/2008/gcc-2008-proceedings.pdf, pp. 33-42.
* * *
From: http://gcc.gnu.org/ml/fortran/2008-07/msg00166.html
PS The example from Daniel,
SUBROUTINE sub(I)
REAL, PARAMETER :: PI = 3.1415
REAL, DIMENSION(:), POINTER :: I
I = 2.0 * PI**2 * I
END SUBROUTINE
produces a temporary because the scalarizer makes no attempt to
resolve pointers, for obvious reasons. We could add a check that the
only pointer on the rhs is the same as that on the lhs, with no
dependencies, and that there are no targets in the rhs expression.
--
Summary: Unneccessary array temporary for same_array = scalar *
same_array
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36915
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/36915] Unneccessary array temporary for same_array_ptr = const * same_array_ptr
2008-07-24 8:39 [Bug fortran/36915] New: Unneccessary array temporary for same_array = scalar * same_array burnus at gcc dot gnu dot org
@ 2008-07-24 10:14 ` dfranke at gcc dot gnu dot org
2008-07-24 13:03 ` rguenth at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2008-07-24 10:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from dfranke at gcc dot gnu dot org 2008-07-24 10:14 -------
Tobias, thanks for opening the PR.
--
dfranke at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dfranke at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36915
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/36915] Unneccessary array temporary for same_array_ptr = const * same_array_ptr
2008-07-24 8:39 [Bug fortran/36915] New: Unneccessary array temporary for same_array = scalar * same_array burnus at gcc dot gnu dot org
2008-07-24 10:14 ` [Bug fortran/36915] Unneccessary array temporary for same_array_ptr = const * same_array_ptr dfranke at gcc dot gnu dot org
@ 2008-07-24 13:03 ` rguenth at gcc dot gnu dot org
2008-07-25 8:44 ` burnus at gcc dot gnu dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-07-24 13:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2008-07-24 13:03 -------
See also PR36842 which would benefit as well.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu dot
| |org
OtherBugsDependingO| |36842
nThis| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36915
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/36915] Unneccessary array temporary for same_array_ptr = const * same_array_ptr
2008-07-24 8:39 [Bug fortran/36915] New: Unneccessary array temporary for same_array = scalar * same_array burnus at gcc dot gnu dot org
2008-07-24 10:14 ` [Bug fortran/36915] Unneccessary array temporary for same_array_ptr = const * same_array_ptr dfranke at gcc dot gnu dot org
2008-07-24 13:03 ` rguenth at gcc dot gnu dot org
@ 2008-07-25 8:44 ` burnus at gcc dot gnu dot org
2008-07-28 10:39 ` tkoenig at gcc dot gnu dot org
2010-05-09 20:25 ` dfranke at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-07-25 8:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from burnus at gcc dot gnu dot org 2008-07-25 08:43 -------
See also PR 36928 (interleaved assignment, where also an unneeded temporary is
created).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36915
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/36915] Unneccessary array temporary for same_array_ptr = const * same_array_ptr
2008-07-24 8:39 [Bug fortran/36915] New: Unneccessary array temporary for same_array = scalar * same_array burnus at gcc dot gnu dot org
` (2 preceding siblings ...)
2008-07-25 8:44 ` burnus at gcc dot gnu dot org
@ 2008-07-28 10:39 ` tkoenig at gcc dot gnu dot org
2010-05-09 20:25 ` dfranke at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2008-07-28 10:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from tkoenig at gcc dot gnu dot org 2008-07-28 10:38 -------
Confirmed.
--
tkoenig 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-07-28 10:38:58
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36915
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/36915] Unneccessary array temporary for same_array_ptr = const * same_array_ptr
2008-07-24 8:39 [Bug fortran/36915] New: Unneccessary array temporary for same_array = scalar * same_array burnus at gcc dot gnu dot org
` (3 preceding siblings ...)
2008-07-28 10:39 ` tkoenig at gcc dot gnu dot org
@ 2010-05-09 20:25 ` dfranke at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-09 20:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from dfranke at gcc dot gnu dot org 2010-05-09 20:25 -------
This seemingly was fixed a while ago; -Warray-temporaries does not warn for
4.4.3, 4.5.1 nor current trunk.
Relevant section of the dump is:
while (1)
{
if (S.0 > D.1515) goto L.1;
(*D.1516)[(S.0 + D.1520) * D.1523 + D.1517] = (*D.1512)[S.0 * D.1522
+ D.1513] * 1.973804473876953125e+1;
S.0 = S.0 + 1;
}
Closing as fixed.
--
dfranke at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.4.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36915
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-05-09 20:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-24 8:39 [Bug fortran/36915] New: Unneccessary array temporary for same_array = scalar * same_array burnus at gcc dot gnu dot org
2008-07-24 10:14 ` [Bug fortran/36915] Unneccessary array temporary for same_array_ptr = const * same_array_ptr dfranke at gcc dot gnu dot org
2008-07-24 13:03 ` rguenth at gcc dot gnu dot org
2008-07-25 8:44 ` burnus at gcc dot gnu dot org
2008-07-28 10:39 ` tkoenig at gcc dot gnu dot org
2010-05-09 20:25 ` 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).