r255973 - in /trunk/gcc: ChangeLog c-family/Cha...

ebotcazou@gcc.gnu.org ebotcazou@gcc.gnu.org
Fri Dec 22 10:22:00 GMT 2017


Author: ebotcazou
Date: Fri Dec 22 10:22:15 2017
New Revision: 255973

URL: https://gcc.gnu.org/viewcvs?rev=255973&root=gcc&view=rev
Log:
	* doc/extend.texi (Loop-Specific Pragmas): Document pragma GCC unroll.
c-family/
	* c-pragma.c (init_pragma): Register pragma GCC unroll.
	* c-pragma.h (enum pragma_kind): Add PRAGMA_UNROLL.
c/
	* c-parser.c (c_parser_while_statement): Add unroll parameter and
	build ANNOTATE_EXPR if present.  Add 3rd operand to ANNOTATE_EXPR.
	(c_parser_do_statement): Likewise.
	(c_parser_for_statement): Likewise.
	(c_parser_statement_after_labels): Adjust calls to above.
	(c_parse_pragma_ivdep): New static function.
	(c_parser_pragma_unroll): Likewise.
	(c_parser_pragma) <PRAGMA_IVDEP>: Add support for pragma Unroll.
	<PRAGMA_UNROLL>: New case.
cp/
	* constexpr.c (cxx_eval_constant_expression) <ANNOTATE_EXPR>: Remove
	assertion on 2nd operand.
	(potential_constant_expression_1): Likewise.
	* cp-tree.def (RANGE_FOR_STMT): Take a 5th operand.
	* cp-tree.h (RANGE_FOR_UNROLL): New macro.
	(cp_convert_range_for): Adjust prototype.
	(finish_while_stmt_cond): Likewise.
	(finish_do_stmt): Likewise.
	(finish_for_cond): Likewise.
	* init.c (build_vec_init): Adjut call to finish_for_cond.
	* parser.c (cp_parser_statement): Adjust call to
	cp_parser_iteration_statement.
	(cp_parser_for): Add unroll parameter and pass it in calls to
	cp_parser_range_for and cp_parser_c_for.
	(cp_parser_c_for): Add unroll parameter and pass it in call to
	finish_for_cond.
	(cp_parser_range_for): Add unroll parameter, set in on RANGE_FOR_STMT
	and pass it in call to cp_convert_range_for.
	(cp_convert_range_for): Add unroll parameter and pass it in call to
	finish_for_cond.
	(cp_parser_iteration_statement): Add unroll parameter and pass it in
	calls to finish_while_stmt_cond, finish_do_stmt and cp_parser_for.
	(cp_parser_pragma_ivdep): New static function.
	(cp_parser_pragma_unroll): Likewise.
	(cp_parser_pragma) <PRAGMA_IVDEP>: Add support for pragma Unroll.
	<PRAGMA_UNROLL>: New case.
	* pt.c (tsubst_expr) <FOR_STMT>: Adjust call to finish_for_cond.
	<RANGE_FOR_STMT>: Pass unrolling factor to cp_convert_range_for.
	<WHILE_STMT>: Adjust call to finish_while_stmt_cond.
	<DO_STMT>: Adjust call to finish_do_stmt.
	* semantics.c (finish_while_stmt_cond): Add unroll parameter and
	build ANNOTATE_EXPR if present.
	(finish_do_stmt): Likewise.
	(finish_for_cond): Likewise.
	(begin_range_for_stmt): Build RANGE_FOR_STMT with 5th operand.
fortran/
	* 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.
	* gfortran.texi (GNU Fortran Compiler Directives): Split section into
	subections 'ATTRIBUTES directive' and 'UNROLL directive'.

Added:
    trunk/gcc/testsuite/c-c++-common/unroll-1.c
    trunk/gcc/testsuite/c-c++-common/unroll-2.c
    trunk/gcc/testsuite/c-c++-common/unroll-3.c
    trunk/gcc/testsuite/c-c++-common/unroll-4.c
    trunk/gcc/testsuite/c-c++-common/unroll-5.c
    trunk/gcc/testsuite/g++.dg/ext/unroll-1.C
    trunk/gcc/testsuite/g++.dg/ext/unroll-2.C
    trunk/gcc/testsuite/g++.dg/ext/unroll-3.C
    trunk/gcc/testsuite/gfortran.dg/directive_unroll_1.f90
    trunk/gcc/testsuite/gfortran.dg/directive_unroll_2.f90
    trunk/gcc/testsuite/gfortran.dg/directive_unroll_3.f90
    trunk/gcc/testsuite/gfortran.dg/directive_unroll_4.f90
    trunk/gcc/testsuite/gfortran.dg/directive_unroll_5.f90
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-pragma.c
    trunk/gcc/c-family/c-pragma.h
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-parser.c
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/constexpr.c
    trunk/gcc/cp/cp-tree.def
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/init.c
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/pt.c
    trunk/gcc/cp/semantics.c
    trunk/gcc/doc/extend.texi
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/array.c
    trunk/gcc/fortran/decl.c
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/gfortran.texi
    trunk/gcc/fortran/match.c
    trunk/gcc/fortran/match.h
    trunk/gcc/fortran/parse.c
    trunk/gcc/fortran/trans-stmt.c
    trunk/gcc/testsuite/ChangeLog



More information about the Gcc-cvs mailing list