The following makes

int foo (int i)
{
  int j = -1 + i;
  return j + i;
}

-gimple dumps consumable by -fgimple without hand-editing the
non-obvious error.

Bootstrap & regtest running on x86_64-unknown-linux-gnu.

Richard.

2019-03-14  Richard Biener  <rguent...@suse.de>

        * tree-pretty-print.c (dump_generic_node): For -gimple properly
        dump negative integer constants using _Literal (type) -num.

Index: gcc/tree-pretty-print.c
===================================================================
--- gcc/tree-pretty-print.c     (revision 269569)
+++ gcc/tree-pretty-print.c     (working copy)
@@ -1830,7 +1830,8 @@ dump_generic_node (pretty_printer *pp, t
          && (POINTER_TYPE_P (TREE_TYPE (node))
              || (TYPE_PRECISION (TREE_TYPE (node))
                  < TYPE_PRECISION (integer_type_node))
-             || exact_log2 (TYPE_PRECISION (TREE_TYPE (node))) == -1))
+             || exact_log2 (TYPE_PRECISION (TREE_TYPE (node))) == -1
+             || tree_int_cst_sgn (node) < 0))
        {
          pp_string (pp, "_Literal (");
          dump_generic_node (pp, TREE_TYPE (node), spc, flags, false);

Reply via email to