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 for c++/19312


The problem was that stabilize_init assumed that the initializer operand of
a TARGET_EXPR would usually be a call; in the affected testcases it is a
variable or aggregate initializer.

Tested i686-pc-linux-gnu, applied to trunk and 4.0.  Tset in
g++.dg/eh/throw3.C.

2005-04-06  Jason Merrill  <jason@redhat.com>

	PR c++/19312
	* tree.c (stabilize_init): Don't bother trying to stabilize
	something with no side-effects.

*** tree.c.~1~	2005-04-05 18:12:44.000000000 -0400
--- tree.c	2005-04-05 23:53:38.709312806 -0400
*************** stabilize_init (tree init, tree *initp)
*** 2257,2263 ****
        if (TREE_CODE (t) == COND_EXPR)
  	return false;
  
!       stabilize_call (t, initp);
      }
  
    return true;
--- 2257,2266 ----
        if (TREE_CODE (t) == COND_EXPR)
  	return false;
  
!       /* The TARGET_EXPR might be initializing via bitwise copy from
! 	 another variable; leave that alone.  */
!       if (TREE_SIDE_EFFECTS (t))
! 	stabilize_call (t, initp);
      }
  
    return true;

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