This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/44235] array temporary with high upper bound
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Aug 2010 11:17:29 -0000
- Subject: [Bug fortran/44235] array temporary with high upper bound
- References: <bug-44235-10391@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from tkoenig at gcc dot gnu dot org 2010-08-07 11:17 -------
(In reply to comment #6)
Hi Dominique,
> It turns out that the test in comment #0 was not fixed by the patch in comment
> #5, but by revision 162966. However with the slight change
>
> a(4:23:3) = a(4:22:3)
>
> a temporary is still created. The patch in comment #5 avoid temporaries in
> situations such as
>
> a(4:19:3) = a(7:22:3)
> a(4:20:3) = a(7:22:3)
> a(4:19:3) = a(7:23:3)
> nl = 4
> nu = 20
> a(1:16:3) = a(4:nu:3)
> a(1:16:3) = a(nl:20:3)
>
> but not for
>
> a(1:16:3) = a(nl:nu:3)
the only unnecessary temporary still created with current trunk is your first
example.
I am more in favor of changing the upper bound to its actual value,
probably during resolution.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44235