summaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2013-10-24 16:25:44 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2013-10-24 16:25:44 +0000
commit4644b59321661f7641c3d2a3816c811d8cb1de2f (patch)
treeddaa06506f828f6ab35f493e688951e5b042fbdf /gcc/gimplify.c
parentc4d85af9120b0f854cf24f7124c0b5c82d939c71 (diff)
downloadgcc-4644b59321661f7641c3d2a3816c811d8cb1de2f.tar.gz
2013-08-24 Tobias Burnus <burnus@net-b.de>
PR other/33426 * c-pragma.c (init_pragma) Add #pragma ivdep handling. * c-pragma.h (pragma_kind): Add PRAGMA_IVDEP. PR other/33426 * c-parser.c (c_parser_pragma, c_parser_for_statement): Handle PRAGMA_IVDEP. (c_parser_statement_after_labels): Update call. PR other/33426 * tree-cfg.c (replace_loop_annotate): New function. (execute_build_cfg): Call it. * gimplify.c (gimple_boolify, gimplify_expr): Handle * ANNOTATE_EXPR. * internal-fn.c (expand_ANNOTATE): New function. * internal-fn.def (ANNOTATE): Define as new internal function. * tree-core.h (tree_node_kind): Add annot_expr_ivdep_kind. * tree-pretty-print.c (dump_generic_node): Handle ANNOTATE_EXPR. * tree.def (ANNOTATE_EXPR): New DEFTREECODE. * doc/extend.texi (Pragmas): Document #pragma ivdep. * doc/generic.texi (Expressions): Document ANNOTATE_EXPR. PR other/33426 * testsuite/gcc.dg/ivdep.c: New. * testsuite/gcc.dg/vect/vect-ivdep-1.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204021 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index fa1b1550076..8d7844005bf 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -3076,6 +3076,17 @@ gimple_boolify (tree expr)
TREE_TYPE (expr) = boolean_type_node;
return expr;
+ case ANNOTATE_EXPR:
+ if ((enum annot_expr_kind) TREE_INT_CST_LOW (TREE_OPERAND (expr, 1))
+ == annot_expr_ivdep_kind)
+ {
+ TREE_OPERAND (expr, 0) = gimple_boolify (TREE_OPERAND (expr, 0));
+ if (TREE_CODE (type) != BOOLEAN_TYPE)
+ TREE_TYPE (expr) = boolean_type_node;
+ return expr;
+ }
+ /* FALLTHRU */
+
default:
if (COMPARISON_CLASS_P (expr))
{
@@ -7731,6 +7742,21 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
ret = gimplify_addr_expr (expr_p, pre_p, post_p);
break;
+ case ANNOTATE_EXPR:
+ {
+ tree cond = TREE_OPERAND (*expr_p, 0);
+ tree id = TREE_OPERAND (*expr_p, 1);
+ tree tmp = create_tmp_var_raw (TREE_TYPE(cond), NULL);
+ gimplify_arg (&cond, pre_p, EXPR_LOCATION (*expr_p));
+ gimple call = gimple_build_call_internal (IFN_ANNOTATE, 2,
+ cond, id);
+ gimple_call_set_lhs (call, tmp);
+ gimplify_seq_add_stmt (pre_p, call);
+ *expr_p = tmp;
+ ret = GS_ALL_DONE;
+ break;
+ }
+
case VA_ARG_EXPR:
ret = gimplify_va_arg_expr (expr_p, pre_p, post_p);
break;