This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, fortran] [12/66] inline sum and product: Preliminary cleanups: Stop loop before end marker.


We should not be writing to gfc_ss_terminator.
It is working without this patch because gfc_ss_terminator's next pointer is
NULL, so the loop stops just after it, and because we are writing zero to
gfc_ss_terminator, but it is already all zeros anyway.
OK?

Attachment: pr43829-12.CL
Description: Text document

diff --git a/trans-array.c b/trans-array.c
index cfbe909..f611302 100644
--- a/trans-array.c
+++ b/trans-array.c
@@ -3114,7 +3114,7 @@ gfc_trans_scalarizing_loops (gfc_loopinfo * loop, stmtblock_t * body)
   gfc_add_expr_to_block (&loop->pre, tmp);
 
   /* Clear all the used flags.  */
-  for (ss = loop->ss; ss; ss = ss->loop_chain)
+  for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain)
     ss->useflags = 0;
 }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]