+2017-02-14 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
+
+ * gimple-pretty-print.c (dump_unary_rhs): Adjust dump format for
+ ABS_EXPR for gimple dump.
+
2017-02-14 Jakub Jelinek <jakub@redhat.com>
PR target/79462
+2017-02-14 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
+
+ * gimpler-parser.c (c_parser_gimple_statement): Handle ABS_EXPR.
+ (c_parser_gimple_unary_expression): Likewise.
+
2017-02-13 Jakub Jelinek <jakub@redhat.com>
* c-parser.c (c_parser_oacc_declare): Add missing space in
/* Unary expression. */
switch (c_parser_peek_token (parser)->type)
{
+ case CPP_NAME:
+ {
+ tree id = c_parser_peek_token (parser)->value;
+ if (strcmp (IDENTIFIER_POINTER (id), "__ABS") == 0)
+ goto build_unary_expr;
+ break;
+ }
case CPP_KEYWORD:
if (c_parser_peek_token (parser)->keyword != RID_REALPART
&& c_parser_peek_token (parser)->keyword != RID_IMAGPART)
case CPP_COMPL:
case CPP_NOT:
case CPP_MULT: /* pointer deref */
+ build_unary_expr:
rhs = c_parser_gimple_unary_expression (parser);
if (rhs.value != error_mark_node)
{
unary-operator gimple-postfix-expression
unary-operator: one of
- & * + - ~
+ & * + - ~ abs_expr
*/
static c_expr
default:
return c_parser_gimple_postfix_expression (parser);
}
+ case CPP_NAME:
+ {
+ tree id = c_parser_peek_token (parser)->value;
+ if (strcmp (IDENTIFIER_POINTER (id), "__ABS") == 0)
+ {
+ c_parser_consume_token (parser);
+ op = c_parser_gimple_postfix_expression (parser);
+ return parser_build_unary_op (op_loc, ABS_EXPR, op);
+ }
+ else
+ return c_parser_gimple_postfix_expression (parser);
+ }
default:
return c_parser_gimple_postfix_expression (parser);
}
break;
case ABS_EXPR:
- pp_string (buffer, "ABS_EXPR <");
- dump_generic_node (buffer, rhs, spc, flags, false);
- pp_greater (buffer);
+ if (flags & TDF_GIMPLE)
+ {
+ pp_string (buffer, "__ABS ");
+ dump_generic_node (buffer, rhs, spc, flags, false);
+ }
+ else
+ {
+ pp_string (buffer, "ABS_EXPR <");
+ dump_generic_node (buffer, rhs, spc, flags, false);
+ pp_greater (buffer);
+ }
break;
default:
+2017-02-14 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
+
+ * gcc.dg/gimplefe-25.c: New test.
+
2017-02-14 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/79408
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O -fgimple -fdump-tree-ssa-gimple" } */
+
+int __GIMPLE() f(int a)
+{
+ int t0;
+ t0_1 = __ABS a;
+ return t0_1;
+}
+
+/* { dg-final { scan-tree-dump "__ABS a" "ssa" } } */