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] Fixup gfortran regressions I introduced


This fixes the char_result_*.f90 ICEs that happen because
remove_unused_block_scopes doesn't honor BLOCK uses in types
(TYPE_MAX_VALUE of TYPE_DOMAIN of array types in this particular case).

Of course that a TREE_BLOCK appears there is bogus anyway and is
actually introduced by inlining itself (so you hit this only
if repeatedly inlining and on the way removing a (not) unused scope 
block).

The fix is easy though, as follows.

Bootstrap and regtest in progress, I'll apply this after it succeeded.

Richard.

2009-12-01  Richard Guenther  <rguenther@suse.de>

	* tree-inline.c (copy_tree_body_r): Do not set TREE_BLOCK
	to the block of the call when remapping a type.

Index: gcc/tree-inline.c
===================================================================
*** gcc/tree-inline.c	(revision 154868)
--- gcc/tree-inline.c	(working copy)
*************** copy_tree_body_r (tree *tp, int *walk_su
*** 1093,1102 ****
  
        /* If EXPR has block defined, map it to newly constructed block.
           When inlining we want EXPRs without block appear in the block
! 	 of function call.  */
        if (EXPR_P (*tp))
  	{
! 	  new_block = id->block;
  	  if (TREE_BLOCK (*tp))
  	    {
  	      tree *n;
--- 1093,1102 ----
  
        /* If EXPR has block defined, map it to newly constructed block.
           When inlining we want EXPRs without block appear in the block
! 	 of function call if we are not remapping a type.  */
        if (EXPR_P (*tp))
  	{
! 	  new_block = id->remapping_type_depth == 0 ? id->block : NULL;
  	  if (TREE_BLOCK (*tp))
  	    {
  	      tree *n;


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