[tree-ssa] PATCH to bsi_insert_after wrt empty blocks

Jason Merrill jason@redhat.com
Tue Jul 1 18:14:00 GMT 2003


While working on another patch, I started getting a spurious "expr_type
might be used uninitialized" warning building cp/pt.o.  When I
investigated, I found that unssa was adding a copy in the wrong place.  The
code looks like

if (...)
  {
    # block 119
    {
      # block 120
      label:
      ...
    }
    # here
  }

and it wants to add a copy on the edge from 119 (an empty block) to 120.
But bsi_insert_after was adding the copy after the first statement nested
within block 119: in this case, the BIND_EXPR.  So the copy wound up at
"here", which is much too late for the uses inside the BIND_EXPR.

Fixed thus.  Testing now; any comments?

2003-07-01  Jason Merrill  <jason@redhat.com>

	* tree-cfg.c (prepend_stmt_to_bb): New fn.
	(bsi_insert_after): Add to the beginning of an empty block.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-patch
Size: 1595 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20030701/77f831bd/attachment.bin>


More information about the Gcc-patches mailing list