X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Fgimple-pretty-print.c;h=7b29aa6c17ed70393fcf4534404b8ceb2d134bb8;hp=1f6efc993f2d7c5f702059ea3e0c53887bf88ac7;hb=adf398f277c9860f464bb108c4cd5502c516eae9;hpb=8a2caf10dc2cc415e4b494611dad5c8bffb7c9df diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c index 1f6efc993f2..7b29aa6c17e 100644 --- a/gcc/gimple-pretty-print.c +++ b/gcc/gimple-pretty-print.c @@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-pass.h" #include "gimple.h" #include "value-prof.h" +#include "trans-mem.h" #define INDENT(SPACE) \ do { int i; for (i = 0; i < SPACE; i++) pp_space (buffer); } while (0) @@ -162,6 +163,7 @@ debug_gimple_seq (gimple_seq seq) 'd' - outputs an int as a decimal, 's' - outputs a string, 'n' - outputs a newline, + 'x' - outputs an int as hexadecimal, '+' - increases indent by 2 then outputs a newline, '-' - decreases indent by 2 then outputs a newline. */ @@ -216,6 +218,10 @@ dump_gimple_fmt (pretty_printer *buffer, int spc, int flags, newline_and_indent (buffer, spc); break; + case 'x': + pp_scalar (buffer, "%x", va_arg (args, int)); + break; + case '+': spc += 2; newline_and_indent (buffer, spc); @@ -339,10 +345,8 @@ dump_binary_rhs (pretty_printer *buffer, gimple gs, int spc, int flags) case VEC_PACK_TRUNC_EXPR: case VEC_PACK_SAT_EXPR: case VEC_PACK_FIX_TRUNC_EXPR: - case VEC_EXTRACT_EVEN_EXPR: - case VEC_EXTRACT_ODD_EXPR: - case VEC_INTERLEAVE_HIGH_EXPR: - case VEC_INTERLEAVE_LOW_EXPR: + case VEC_WIDEN_LSHIFT_HI_EXPR: + case VEC_WIDEN_LSHIFT_LO_EXPR: for (p = tree_code_name [(int) code]; *p; p++) pp_character (buffer, TOUPPER (*p)); pp_string (buffer, " <"); @@ -417,6 +421,16 @@ dump_ternary_rhs (pretty_printer *buffer, gimple gs, int spc, int flags) dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false); pp_string (buffer, ">"); break; + + case VEC_PERM_EXPR: + pp_string (buffer, "VEC_PERM_EXPR <"); + dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false); + pp_string (buffer, ", "); + dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false); + pp_string (buffer, ", "); + dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false); + pp_string (buffer, ">"); + break; case REALIGN_LOAD_EXPR: pp_string (buffer, "REALIGN_LOAD <"); @@ -600,8 +614,6 @@ pp_points_to_solution (pretty_printer *buffer, struct pt_solution *pt) pp_character (buffer, '}'); if (pt->vars_contains_global) pp_string (buffer, " (glob)"); - if (pt->vars_contains_restrict) - pp_string (buffer, " (restr)"); } } @@ -612,6 +624,7 @@ static void dump_gimple_call (pretty_printer *buffer, gimple gs, int spc, int flags) { tree lhs = gimple_call_lhs (gs); + tree fn = gimple_call_fn (gs); if (flags & TDF_ALIAS) { @@ -638,8 +651,7 @@ dump_gimple_call (pretty_printer *buffer, gimple gs, int spc, int flags) dump_gimple_fmt (buffer, spc, flags, "%G <%s, %T", gs, internal_fn_name (gimple_call_internal_fn (gs)), lhs); else - dump_gimple_fmt (buffer, spc, flags, "%G <%T, %T", - gs, gimple_call_fn (gs), lhs); + dump_gimple_fmt (buffer, spc, flags, "%G <%T, %T", gs, fn, lhs); if (gimple_call_num_args (gs) > 0) { pp_string (buffer, ", "); @@ -662,7 +674,7 @@ dump_gimple_call (pretty_printer *buffer, gimple gs, int spc, int flags) if (gimple_call_internal_p (gs)) pp_string (buffer, internal_fn_name (gimple_call_internal_fn (gs))); else - print_call_name (buffer, gimple_call_fn (gs), flags); + print_call_name (buffer, fn, flags); pp_string (buffer, " ("); dump_gimple_call_args (buffer, gs, flags); pp_character (buffer, ')'); @@ -679,9 +691,62 @@ dump_gimple_call (pretty_printer *buffer, gimple gs, int spc, int flags) if (gimple_call_return_slot_opt_p (gs)) pp_string (buffer, " [return slot optimization]"); - if (gimple_call_tail_p (gs)) pp_string (buffer, " [tail call]"); + + if (fn == NULL) + return; + + /* Dump the arguments of _ITM_beginTransaction sanely. */ + if (TREE_CODE (fn) == ADDR_EXPR) + fn = TREE_OPERAND (fn, 0); + if (TREE_CODE (fn) == FUNCTION_DECL && decl_is_tm_clone (fn)) + pp_string (buffer, " [tm-clone]"); + if (TREE_CODE (fn) == FUNCTION_DECL + && DECL_BUILT_IN_CLASS (fn) == BUILT_IN_NORMAL + && DECL_FUNCTION_CODE (fn) == BUILT_IN_TM_START + && gimple_call_num_args (gs) > 0) + { + tree t = gimple_call_arg (gs, 0); + unsigned HOST_WIDE_INT props; + gcc_assert (TREE_CODE (t) == INTEGER_CST); + + pp_string (buffer, " [ "); + + /* Get the transaction code properties. */ + props = TREE_INT_CST_LOW (t); + + if (props & PR_INSTRUMENTEDCODE) + pp_string (buffer, "instrumentedCode "); + if (props & PR_UNINSTRUMENTEDCODE) + pp_string (buffer, "uninstrumentedCode "); + if (props & PR_HASNOXMMUPDATE) + pp_string (buffer, "hasNoXMMUpdate "); + if (props & PR_HASNOABORT) + pp_string (buffer, "hasNoAbort "); + if (props & PR_HASNOIRREVOCABLE) + pp_string (buffer, "hasNoIrrevocable "); + if (props & PR_DOESGOIRREVOCABLE) + pp_string (buffer, "doesGoIrrevocable "); + if (props & PR_HASNOSIMPLEREADS) + pp_string (buffer, "hasNoSimpleReads "); + if (props & PR_AWBARRIERSOMITTED) + pp_string (buffer, "awBarriersOmitted "); + if (props & PR_RARBARRIERSOMITTED) + pp_string (buffer, "RaRBarriersOmitted "); + if (props & PR_UNDOLOGCODE) + pp_string (buffer, "undoLogCode "); + if (props & PR_PREFERUNINSTRUMENTED) + pp_string (buffer, "preferUninstrumented "); + if (props & PR_EXCEPTIONBLOCK) + pp_string (buffer, "exceptionBlock "); + if (props & PR_HASELSE) + pp_string (buffer, "hasElse "); + if (props & PR_READONLY) + pp_string (buffer, "readOnly "); + + pp_string (buffer, "]"); + } } @@ -937,6 +1002,24 @@ dump_gimple_eh_must_not_throw (pretty_printer *buffer, gimple gs, } +/* Dump a GIMPLE_EH_ELSE tuple on the pretty_printer BUFFER, SPC spaces of + indent. FLAGS specifies details to show in the dump (see TDF_* in + tree-pass.h). */ + +static void +dump_gimple_eh_else (pretty_printer *buffer, gimple gs, int spc, int flags) +{ + if (flags & TDF_RAW) + dump_gimple_fmt (buffer, spc, flags, + "%G <%+N_BODY <%S>%nE_BODY <%S>%->", gs, + gimple_eh_else_n_body (gs), gimple_eh_else_e_body (gs)); + else + dump_gimple_fmt (buffer, spc, flags, + "<<>>%+{%S}%-<<>>%+{%S}", + gimple_eh_else_n_body (gs), gimple_eh_else_e_body (gs)); +} + + /* Dump a GIMPLE_RESX tuple on the pretty_printer BUFFER, SPC spaces of indent. FLAGS specifies details to show in the dump (see TDF_* in tree-pass.h). */ @@ -1259,6 +1342,86 @@ dump_gimple_omp_return (pretty_printer *buffer, gimple gs, int spc, int flags) } } +/* Dump a GIMPLE_TRANSACTION tuple on the pretty_printer BUFFER. */ + +static void +dump_gimple_transaction (pretty_printer *buffer, gimple gs, int spc, int flags) +{ + unsigned subcode = gimple_transaction_subcode (gs); + + if (flags & TDF_RAW) + { + dump_gimple_fmt (buffer, spc, flags, + "%G [SUBCODE=%x,LABEL=%T] <%+BODY <%S> >", + gs, subcode, gimple_transaction_label (gs), + gimple_transaction_body (gs)); + } + else + { + if (subcode & GTMA_IS_OUTER) + pp_string (buffer, "__transaction_atomic [[outer]]"); + else if (subcode & GTMA_IS_RELAXED) + pp_string (buffer, "__transaction_relaxed"); + else + pp_string (buffer, "__transaction_atomic"); + subcode &= ~GTMA_DECLARATION_MASK; + + if (subcode || gimple_transaction_label (gs)) + { + pp_string (buffer, " //"); + if (gimple_transaction_label (gs)) + { + pp_string (buffer, " LABEL="); + dump_generic_node (buffer, gimple_transaction_label (gs), + spc, flags, false); + } + if (subcode) + { + pp_string (buffer, " SUBCODE=[ "); + if (subcode & GTMA_HAVE_ABORT) + { + pp_string (buffer, "GTMA_HAVE_ABORT "); + subcode &= ~GTMA_HAVE_ABORT; + } + if (subcode & GTMA_HAVE_LOAD) + { + pp_string (buffer, "GTMA_HAVE_LOAD "); + subcode &= ~GTMA_HAVE_LOAD; + } + if (subcode & GTMA_HAVE_STORE) + { + pp_string (buffer, "GTMA_HAVE_STORE "); + subcode &= ~GTMA_HAVE_STORE; + } + if (subcode & GTMA_MAY_ENTER_IRREVOCABLE) + { + pp_string (buffer, "GTMA_MAY_ENTER_IRREVOCABLE "); + subcode &= ~GTMA_MAY_ENTER_IRREVOCABLE; + } + if (subcode & GTMA_DOES_GO_IRREVOCABLE) + { + pp_string (buffer, "GTMA_DOES_GO_IRREVOCABLE "); + subcode &= ~GTMA_DOES_GO_IRREVOCABLE; + } + if (subcode) + pp_printf (buffer, "0x%x ", subcode); + pp_string (buffer, "]"); + } + } + + if (!gimple_seq_empty_p (gimple_transaction_body (gs))) + { + newline_and_indent (buffer, spc + 2); + pp_character (buffer, '{'); + pp_newline (buffer); + dump_gimple_seq (buffer, gimple_transaction_body (gs), + spc + 4, flags); + newline_and_indent (buffer, spc + 2); + pp_character (buffer, '}'); + } + } +} + /* Dump a GIMPLE_ASM tuple on the pretty_printer BUFFER, SPC spaces of indent. FLAGS specifies details to show in the dump (see TDF_* in tree-pass.h). */ @@ -1432,9 +1595,11 @@ dump_gimple_phi (pretty_printer *buffer, gimple phi, int spc, int flags) pp_points_to_solution (buffer, &pi->pt); newline_and_indent (buffer, spc); if (pi->align != 1) - pp_printf (buffer, "# ALIGN = %u, MISALIGN = %u", - pi->align, pi->misalign); - newline_and_indent (buffer, spc); + { + pp_printf (buffer, "# ALIGN = %u, MISALIGN = %u", + pi->align, pi->misalign); + newline_and_indent (buffer, spc); + } pp_string (buffer, "# "); } @@ -1604,6 +1769,8 @@ dump_gimple_omp_atomic_load (pretty_printer *buffer, gimple gs, int spc, else { pp_string (buffer, "#pragma omp atomic_load"); + if (gimple_omp_atomic_need_value_p (gs)) + pp_string (buffer, " [needed]"); newline_and_indent (buffer, spc + 2); dump_generic_node (buffer, gimple_omp_atomic_load_lhs (gs), spc, flags, false); @@ -1631,7 +1798,10 @@ dump_gimple_omp_atomic_store (pretty_printer *buffer, gimple gs, int spc, } else { - pp_string (buffer, "#pragma omp atomic_store ("); + pp_string (buffer, "#pragma omp atomic_store "); + if (gimple_omp_atomic_need_value_p (gs)) + pp_string (buffer, "[needed] "); + pp_character (buffer, '('); dump_generic_node (buffer, gimple_omp_atomic_store_val (gs), spc, flags, false); pp_character (buffer, ')'); @@ -1845,6 +2015,10 @@ dump_gimple_stmt (pretty_printer *buffer, gimple gs, int spc, int flags) dump_gimple_eh_must_not_throw (buffer, gs, spc, flags); break; + case GIMPLE_EH_ELSE: + dump_gimple_eh_else (buffer, gs, spc, flags); + break; + case GIMPLE_RESX: dump_gimple_resx (buffer, gs, spc, flags); break; @@ -1867,6 +2041,10 @@ dump_gimple_stmt (pretty_printer *buffer, gimple gs, int spc, int flags) pp_string (buffer, " predictor."); break; + case GIMPLE_TRANSACTION: + dump_gimple_transaction (buffer, gs, spc, flags); + break; + default: GIMPLE_NIY; }