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: 8 Aug 2010 22:40:57 -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 #11 from tkoenig at gcc dot gnu dot org 2010-08-08 22:40 -------
(In reply to comment #10)
> > This patch seems to work, and do more or less the right thing.
>
> No counter-example of that!-) thanks.
That's good.
> > It inserts the upper bound only for strides not equal to one.
>
> I am unable to follow the code. Do you mean that you are putting the section in
> some canonical form with the minimal value of 'end'?
That is correct. If the stride is not equal to one, and if the
size can be calculated at compile-time (which the call to gfc_ref_dimen_size
checks, and does), then the end of the array reference is set to the minimum.
I extended that function to also calculate the end.
> What puzzle me is that I
> do not see any division, is it hidden in the gmp calls?
The division is handled in gfc_ref_dimen_size, where I simply used
the size calculatd there to also calculate the minimum end. You'll find
the division there.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44235