This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/37903] [4.3/4.4 Regression] wrong-code for complicated vector subscripts
- From: "mikael dot morin at tele2 dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Oct 2008 12:21:30 -0000
- Subject: [Bug fortran/37903] [4.3/4.4 Regression] wrong-code for complicated vector subscripts
- References: <bug-37903-14266@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from mikael dot morin at tele2 dot fr 2008-10-28 12:21 -------
This is happening because
(1) gfc_trans_constant_array_constructor sets loop->temp_dim to 1.
(2) gfc_conv_loop_setup choses the last ss whose shape is known (that of i).
(3) gfc_conv_loop_setup sets loop bounds (-1->1) according to the chosen ss
(i).
(4) gfc_trans_create_temp_array conditionally resets the loop bounds (if n >=
loop->temp_dim).
(5) gfc_trans_create_temp_array later assumes that the loop starts at zero.
(2) explains why it works with y(i+(/1,1,1/)) but not with y((/1,1,1/)+i)
My patch in comment #3 changes the "last ss" to "first ss" and of course it
doesn't work as was said in comment #6
I have two fixes almost ready.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37903