This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/42878] "-fcompare-debug failure" at -O1 (2)



------- Comment #4 from rguenth at gcc dot gnu dot org  2010-01-27 11:26 -------
But the root cause is SSA names get out-of sync already during early inlining
via .MEMs.  Which is because with debug isns we retain j_11 = 0 in

<bb 5>:
  # VUSE <.MEM_12>
  D.xxxx_10 = s_9->i;
  # .MEM_14 = VDEF <.MEM_12>
  e2 (D.xxxx_10);
  # DEBUG i => i_1(D)
  j_11 = 0;
  # DEBUG j => j_11
  # .MEM_15 = VDEF <.MEM_14>
  e2 (i_1(D));
  # DEBUG j => NULL
  return;

while without it's gone.

<bb 5>:
  # VUSE <.MEM_11>
  D.xxxx_10 = s_9->i;
  # .MEM_13 = VDEF <.MEM_11>
  e2 (D.xxxx_10);
  # .MEM_14 = VDEF <.MEM_13>
  e2 (i_1(D));
  return;


This is because

          /* By inlining function having uninitialized variable, we might
             extend the lifetime (variable might get reused).  This cause
             ICE in the case we end up extending lifetime of SSA name across
             abnormal edge, but also increase register pressure.

             We simply initialize all uninitialized vars by 0 except
             for case we are inlining to very first BB.  We can avoid
             this for all BBs that are not inside strongly connected
             regions of the CFG, but this is expensive to test.  */
          if (id->entry_bb
              && is_gimple_reg (SSA_NAME_VAR (name))
              && TREE_CODE (SSA_NAME_VAR (name)) != PARM_DECL
              && (id->entry_bb != EDGE_SUCC (ENTRY_BLOCK_PTR, 0)->dest
                  || EDGE_COUNT (id->entry_bb->preds) != 1))
            {
              gimple_stmt_iterator gsi = gsi_last_bb (id->entry_bb);
              gimple init_stmt;

              init_stmt = gimple_build_assign (new_tree,
                                               fold_convert (TREE_TYPE
(new_tree),
                                               integer_zero_node));


inserts this assignment also if there are only debug-uses.  We come along
here from re-mapping the default-defs of decls.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42878


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]