[Bug fortran/43829] Scalarization of reductions

mikael at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Oct 5 18:12:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43829

--- Comment #40 from Mikael Morin <mikael at gcc dot gnu.org> 2011-10-05 18:10:08 UTC ---
(In reply to comment #39)
> Regarding the (In reply to comment #37)
> > Sorry, you should have asked for the latest patch.
> > I'll post a more up-to-date than the more up-to-date soon.
> 
> Thanks. One comment: I think you will increase the binary size by inlining the
> reduction. Could you consider keeping the current libgfortran version and
> protecting the scalarization by
>   if (!optimize_size)

I'll give it some thought. 


> 
> Or, if you replace unconditionally the library version, can you list the
> library funcition at http://gcc.gnu.org/wiki/LibgfortranAbiCleanup to make sure
> that it gets removed when gfortran breaks the ABI. (The latter has to happen
> when we change the array descriptor.)

Well, with the patch in its current state, the library code can't be dropped
anyway as sum is inlined only if the DIM argument is constant.
I don't know if the latter condition can be lifted without making the code
awkward. The fact that the scalarizer manages dimensions as int (thus not as
tree) certainly doesn't help, and it's certainly not a 4.7 item.
Hopefully the constant case is sufficiently common to make the optimization
worth the bother.



More information about the Gcc-bugs mailing list