This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Re: [Patch, Fortran] PR43169: [OOP] gfortran rejects pure procedure with select type construct


Hi Paul,


> The patch is fine apart from one bit; that in resolve_code.

thanks for the review.



> The bit that resets gfc_current_ns
> @@ -8165,6 +8169,7 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
>
> ? ? ? ?case EXEC_SELECT_TYPE:
> ? ? ? ? ?resolve_select_type (code);
> + ? ? ? ? gfc_current_ns = ns;
> ? ? ? ? ?break;
>
> is better put as
>
> @@ -8012,6 +8012,11 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
> ? ? ? ? ? ?case EXEC_OMP_DO:
> ? ? ? ? ? ? ?gfc_resolve_omp_do_blocks (code, ns);
> ? ? ? ? ? ? ?break;
> + ? ? ? ? ? case EXEC_SELECT_TYPE:
> + ? ? ? ? ? ? gfc_current_ns = code->ext.ns;
> + ? ? ? ? ? ? gfc_resolve_blocks (code->block, gfc_current_ns);
> + ? ? ? ? ? ? gfc_current_ns = ns;
> + ? ? ? ? ? ? break;
> ? ? ? ? ? ?case EXEC_OMP_WORKSHARE:
> ? ? ? ? ? ? ?omp_workshare_save = omp_workshare_flag;
> ? ? ? ? ? ? ?omp_workshare_flag = 1;
>
> unless I have missed something. ?Certainly it works fine. ?If I am
> wrong, could you please comment the first block to indicate where the
> reset occurs and why.

Well, ok. I thought it would not hurt to apply the correct
gfc_current_ns also to the call to resolve_select_type, but it seems
it is not needed. Your version regtests just as fine as mine, and it
is clearer since both assignments happen in one place.


> Apart from this, it is OK for trunk.

Thanks. Will commit with your change.

Cheers,
Janus


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