[patch, fortran] Fix PR 50327, regression in DO WHILE

Tobias Burnus burnus@net-b.de
Sun Sep 11 17:23:00 GMT 2011


Thomas Koenig wrote:
> the attached patch fixes the PR by transforming
>
>   DO WHILE (condition)
>     ...
>   END DO
>
> into the equvialent
>
>   DO WHILE(.true.)
>     IF (.not. condition) exit
>     ...
>   END DO
>
> before applying common function elimination.

Which matches what the current code in trans*.c already does (cf. dump 
in the PR).

> OK for trunk?

OK. Thanks for the patch!

Tobias

> 2011-09-10  Thomas Koenig <tkoenig@gcc.gnu.org>
>
>         PR fortran/50327
>         * frontend-passes.c (dummy_expr_callback):  New function.
>         (convert_do_while):  New function.
>         (optimize_namespace):  Call code walker to convert do while 
> loops.
>
> 2011-09-10  Thomas Koenig <tkoenig@gcc.gnu.org>
>
>         PR fortran/50327
>         * gfortran.dg/do_while_1.f90:  New test.



More information about the Gcc-patches mailing list