This is the mail archive of the gcc-patches@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]

[PATCH][4.3/4.4] Fix PR40585


Currently tracer happily duplicates basic-blocks with RESX_EXPR 
or GIMPLE_RESX.  This later confuses expansion because that cannot
handle it.

For trunk honza is going to fix expansion, the following patches
for 4.3 and 4.4 adjust {tree,gimple}_can_duplicate_bb_p to say
no to blocks with RESX_EXPR / GIMPLE_RESX.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to
the branches.

Richard.

2009-06-02  Richard Guenther  <rguenther@suse.de>

	PR middle-end/40585
	* tree-cfg.c (gimple_can_duplicate_bb_p): Disallow duplicating
	basic blocks with GIMPLE_RESX.

Index: gcc/tree-cfg.c
===================================================================
*** gcc/tree-cfg.c	(revision 149170)
--- gcc/tree-cfg.c	(working copy)
*************** gimple_move_block_after (basic_block bb,
*** 4923,4928 ****
--- 4923,4932 ----
  static bool
  gimple_can_duplicate_bb_p (const_basic_block bb ATTRIBUTE_UNUSED)
  {
+   gimple_seq_node last = gimple_seq_last (bb_seq (bb));
+   /* We cannot duplicate GIMPLE_RESXs due to expander limitations.  */
+   if (last && gimple_code (last->stmt) == GIMPLE_RESX)
+     return false;
    return true;
  }
  

2009-06-02  Richard Guenther  <rguenther@suse.de>

        PR middle-end/40585
	* tree-cfg.c (gimple_can_duplicate_bb_p): Disallow duplicating
	basic blocks with GIMPLE_RESX.

Index: gcc/tree-cfg.c
===================================================================
*** gcc/tree-cfg.c	(revision 149051)
--- gcc/tree-cfg.c	(working copy)
*************** tree_move_block_after (basic_block bb, b
*** 5048,5055 ****
  /* Return true if basic_block can be duplicated.  */
  
  static bool
! tree_can_duplicate_bb_p (const_basic_block bb ATTRIBUTE_UNUSED)
  {
    return true;
  }
  
--- 5048,5059 ----
  /* Return true if basic_block can be duplicated.  */
  
  static bool
! tree_can_duplicate_bb_p (const_basic_block bb)
  {
+   tree_stmt_iterator tsi = tsi_last (bb_stmt_list (bb));
+   /* We cannot duplicate RESX_EXPRs due to expander limitations.  */
+   if (!tsi_end_p (tsi) && TREE_CODE (tsi_stmt (tsi)) == RESX_EXPR)
+     return false;
    return true;
  }
  


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