This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Make IPA-CP work on aggregates
- From: Jakub Jelinek <jakub at redhat dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Tue, 6 Nov 2012 14:35:30 +0100
- Subject: Re: [PATCH] Make IPA-CP work on aggregates
- References: <20121105235806.GG5617@virgil.arch.suse.de>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Nov 06, 2012 at 12:58:07AM +0100, Martin Jambor wrote:
> 2012-11-05 Martin Jambor <mjambor@suse.cz>
>
> PR tree-optimization/53787
> * ipa-cp.c (ipcp_value_source): New field offset.
...
Is this supposed to do something about Fortran array descriptors
where some fields in the descriptors have known constant values in the
caller?
Say
subroutine bar (a, b, n)
integer :: a(n), b(n)
call foo (a, b)
contains
subroutine foo (a, b)
integer :: a(:), b(:)
a = b
end subroutine
end
-O2 -fno-inline (there could be thousands of better testcases though, this
one doesn't look at too many fields).
With your patch
foo.1899.constprop.0 is created, but I don't see any immediate other
effects. Certainly e.g.
_2 = a_1(D)->dim[0].stride;
if (_2 != 0)
remains till *.optimized dump, even when in the caller it is set to 1.
I guess for Fortran being able to optimize on constant (or even better
constant one) stride would be very worthwhile.
Jakub