Hi, this is the (hopefully) final implementation of the support for the unrolling pragma in the Fortran front-end. However the documentation is still missing because I don't really know where and under which form to put it. Tested on x86_64-suse-linux, OK for the mainline? 2017-11-25 Bernhard Reutner-Fischer Eric Botcazou fortran/ChangeLog: * array.c (gfc_copy_iterator): Copy unroll field. * decl.c (directive_unroll): New global variable. (gfc_match_gcc_unroll): New function. * gfortran.h (gfc_iterator]): Add unroll field. (directive_unroll): Declare: * match.c (gfc_match_do): Use memset to initialize the iterator. * match.h (gfc_match_gcc_unroll): New prototype. * parse.c (decode_gcc_attribute): Match "unroll". (parse_do_block): Set iterator's unroll. (parse_executable): Diagnose misplaced unroll directive. * trans-stmt.c (gfc_trans_simple_do) Annotate loop condition with annot_expr_unroll_kind. (gfc_trans_do): Likewise. testsuite/ChangeLog: * gfortran.dg/directive_unroll_1.f90: New test. * gfortran.dg/directive_unroll_2.f90: Likewise. * gfortran.dg/directive_unroll_3.f90: Lkewise. * gfortran.dg/directive_unroll_4.f90: Likewise. * gfortran.dg/directive_unroll_5.f90: Likewise. -- Eric Botcazou