@@ -140,23 +140,29 @@ enum dump_flag
/* Dump SCEV details. */
TDF_SCEV = (1 << 19),
- /* Dump in GIMPLE FE syntax */
+ /* Dump in GIMPLE FE syntax. */
TDF_GIMPLE = (1 << 20),
/* Dump folding details. */
TDF_FOLDING = (1 << 21),
+ /* Dumping for range path solver. */
+ TDF_THREADING = (1 << 22),
+
+ /* All -fdump- flags. */
+ TDF_ALL_VALUES = (1 << 23) - 1,
+
/* MSG_* flags for expressing the kinds of message to
be emitted by -fopt-info. */
/* -fopt-info optimized sources. */
- MSG_OPTIMIZED_LOCATIONS = (1 << 22),
+ MSG_OPTIMIZED_LOCATIONS = (1 << 23),
/* Missed opportunities. */
- MSG_MISSED_OPTIMIZATION = (1 << 23),
+ MSG_MISSED_OPTIMIZATION = (1 << 24),
/* General optimization info. */
- MSG_NOTE = (1 << 24),
+ MSG_NOTE = (1 << 25),
/* Mask for selecting MSG_-kind flags. */
MSG_ALL_KINDS = (MSG_OPTIMIZED_LOCATIONS
@@ -175,16 +181,16 @@ enum dump_flag
sub-option of -fopt-info to show the internal messages. */
/* Implicitly supplied for messages at the top-level dump scope. */
- MSG_PRIORITY_USER_FACING = (1 << 25),
+ MSG_PRIORITY_USER_FACING = (1 << 26),
/* Implicitly supplied for messages within nested dump scopes. */
- MSG_PRIORITY_INTERNALS = (1 << 26),
+ MSG_PRIORITY_INTERNALS = (1 << 27),
/* Supplied when an opt_problem generated in a nested scope is re-emitted
at the top-level. We want to default to showing these in -fopt-info
output, but to *not* show them in dump files, as the message would be
shown twice, messing up "scan-tree-dump-times" in DejaGnu tests. */
- MSG_PRIORITY_REEMITTED = (1 << 27),
+ MSG_PRIORITY_REEMITTED = (1 << 28),
/* Mask for selecting MSG_PRIORITY_* flags. */
MSG_ALL_PRIORITIES = (MSG_PRIORITY_USER_FACING
@@ -192,16 +198,13 @@ enum dump_flag
| MSG_PRIORITY_REEMITTED),
/* Dumping for -fcompare-debug. */
- TDF_COMPARE_DEBUG = (1 << 28),
+ TDF_COMPARE_DEBUG = (1 << 29),
- /* For error. */
- TDF_ERROR = (1 << 26),
+ /* Dump a GIMPLE value which means wrapping certain things with _Literal. */
+ TDF_GIMPLE_VAL = (1 << 30),
- /* Dumping for range path solver. */
- TDF_THREADING = (1 << 27),
-
- /* All values. */
- TDF_ALL_VALUES = (1 << 29) - 1
+ /* For error. */
+ TDF_ERROR = (1 << 31),
};
/* Dump flags type. */
@@ -677,11 +677,18 @@ dump_gimple_assign (pretty_printer *buffer, const gassign *gs, int spc,
}
if (gimple_num_ops (gs) == 2)
- dump_unary_rhs (buffer, gs, spc, flags);
+ dump_unary_rhs (buffer, gs, spc,
+ ((flags & TDF_GIMPLE)
+ && gimple_assign_rhs_class (gs) == GIMPLE_SINGLE_RHS)
+ ? flags : (flags | TDF_GIMPLE_VAL));
else if (gimple_num_ops (gs) == 3)
- dump_binary_rhs (buffer, gs, spc, flags);
+ dump_binary_rhs (buffer, gs, spc,
+ (flags & TDF_GIMPLE)
+ ? (flags | TDF_GIMPLE_VAL) : flags);
else if (gimple_num_ops (gs) == 4)
- dump_ternary_rhs (buffer, gs, spc, flags);
+ dump_ternary_rhs (buffer, gs, spc,
+ (flags & TDF_GIMPLE)
+ ? (flags | TDF_GIMPLE_VAL) : flags);
else
gcc_unreachable ();
if (!(flags & TDF_RHS_ONLY))
@@ -1085,11 +1092,15 @@ dump_gimple_cond (pretty_printer *buffer, const gcond *gs, int spc,
{
if (!(flags & TDF_RHS_ONLY))
pp_string (buffer, "if (");
- dump_generic_node (buffer, gimple_cond_lhs (gs), spc, flags, false);
+ dump_generic_node (buffer, gimple_cond_lhs (gs), spc,
+ flags | ((flags & TDF_GIMPLE) ? TDF_GIMPLE_VAL : TDF_NONE),
+ false);
pp_space (buffer);
pp_string (buffer, op_symbol_code (gimple_cond_code (gs)));
pp_space (buffer);
- dump_generic_node (buffer, gimple_cond_rhs (gs), spc, flags, false);
+ dump_generic_node (buffer, gimple_cond_rhs (gs), spc,
+ flags | ((flags & TDF_GIMPLE) ? TDF_GIMPLE_VAL : TDF_NONE),
+ false);
if (!(flags & TDF_RHS_ONLY))
{
edge_iterator ei;
@@ -2873,10 +2873,18 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags,
break;
/* Unary arithmetic and logic expressions. */
+ case ADDR_EXPR:
+ if (flags & TDF_GIMPLE_VAL)
+ {
+ pp_string (pp, "_Literal (");
+ dump_generic_node (pp, TREE_TYPE (node), spc,
+ flags & ~TDF_GIMPLE_VAL, false);
+ pp_character (pp, ')');
+ }
+ /* Fallthru. */
case NEGATE_EXPR:
case BIT_NOT_EXPR:
case TRUTH_NOT_EXPR:
- case ADDR_EXPR:
case PREDECREMENT_EXPR:
case PREINCREMENT_EXPR:
case INDIRECT_REF: