[patch, fortran] Fix ICE on invalid with DO steps

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch, fortran] Fix ICE on invalid with DO steps

Thomas Koenig-6
Hello world,

the attached patch fixes an ICE on invalid, where the fact that
the step in do i = 1, 3, .1 is actually zero slipped through.

Regression-tested.  OK for all affected branches (trunk, 9 and 8)?

Regards

        Thomas

2019-09-15  Thomas Koenig  <[hidden email]>

        PR fortran/91550
        * frontend-passes.c (do_subscript): If step equals
        zero, a previuos error has been reported; do nothing
        in this case.
        * resolve.c (gfc_resolve_iterator): Move error checking
        after type conversion.

2019-09-15  Thomas Koenig  <[hidden email]>

        PR fortran/91550
        * gfortran.dg/do_subscript_6.f90: New test.



p2.diff (2K) Download Attachment
do_subscript_6.f90 (256 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [patch, fortran] Fix ICE on invalid with DO steps

Thomas Koenig-6
Hi Steve,

> s/previusly/previously

Fixed, committed. Thanks for the review!

> Do you it gfortran should skip the front-end optimization pass
> if error(s) have already been reported?  On entry ito this pass,
> you could test for the error count and simply return.

I thought about this for doing this here.  It's a front-end pass,
but for error checking and warnings, not an optimization one, so
I thought throwing a few additional errors / warnings would not
hurt.

Regards

        Thomas