From: Prathamesh Kulkarni Date: Thu, 22 Dec 2016 20:30:33 +0000 (+0000) Subject: tree-pretty-print.c (dump_generic_node): Change dump format for REALPART_EXPR and... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cb66382056ed3d00383bed84db0df5b074f8265a;p=gcc.git tree-pretty-print.c (dump_generic_node): Change dump format for REALPART_EXPR and IMAGPART_EXPR with TDF_GIMPLE. 2016-12-22 Prathamesh Kulkarni * tree-pretty-print.c (dump_generic_node): Change dump format for REALPART_EXPR and IMAGPART_EXPR with TDF_GIMPLE. testsuite/ * gcc.dg/gimplefe-20.c: New test-case. From-SVN: r243898 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 64f7b88d3ad..16ca10b945e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-12-22 Prathamesh Kulkarni + + * tree-pretty-print.c (dump_generic_node): Change dump format for + REALPART_EXPR and IMAGPART_EXPR with TDF_GIMPLE. + 2016-12-22 Andreas Krebbel * varasm.c (build_constant_desc): Use the alignment of the var diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 439bcbf0b73..c8b5544eb2c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-12-22 Prathamesh Kulkarni + + * gcc.dg/gimplefe-20.c: New test-case. + 2016-12-22 Andreas Krebbel * gcc.target/s390/litpool-str-1.c: New test. diff --git a/gcc/testsuite/gcc.dg/gimplefe-20.c b/gcc/testsuite/gcc.dg/gimplefe-20.c new file mode 100644 index 00000000000..99b31806481 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gimplefe-20.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fgimple -fdump-tree-ssa-gimple" } */ + +_Complex a; + +double __GIMPLE() f() +{ + double t1; + double t2; + double _1; + +bb1: + t1_2 = __real a; + t2_3 = __imag a; + _1 = t1_2 + t2_3; + return _1; +} + +/* { dg-final { scan-tree-dump "__real a" "ssa" } } */ +/* { dg-final { scan-tree-dump "__imag a" "ssa" } } */ diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index 5b3e23e40f7..40c0bc6defe 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -2451,15 +2451,31 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, int flags, break; case REALPART_EXPR: - pp_string (pp, "REALPART_EXPR <"); - dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); - pp_greater (pp); + if (flags & TDF_GIMPLE) + { + pp_string (pp, "__real "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + } + else + { + pp_string (pp, "REALPART_EXPR <"); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_greater (pp); + } break; case IMAGPART_EXPR: - pp_string (pp, "IMAGPART_EXPR <"); - dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); - pp_greater (pp); + if (flags & TDF_GIMPLE) + { + pp_string (pp, "__imag "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + } + else + { + pp_string (pp, "IMAGPART_EXPR <"); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_greater (pp); + } break; case VA_ARG_EXPR: