Patch to unsave_expr_1

Jason Merrill jason@cygnus.com
Wed Mar 29 12:38:00 GMT 2000


This fixes a crash with the new sibcall code.  Testcase at g++.other/crash15.C.

2000-03-29  Jason Merrill  <jason@casey.cygnus.com>

	* tree.c (unsave_expr_1): Don't mess with a TARGET_EXPR that hasn't
	been expanded.

Index: tree.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/tree.c,v
retrieving revision 1.132
diff -c -p -r1.132 tree.c
*** tree.c	2000/03/26 19:01:54	1.132
--- tree.c	2000/03/29 20:29:26
*************** unsave_expr_1 (expr)
*** 2610,2615 ****
--- 2610,2622 ----
        break;
  
      case TARGET_EXPR:
+       /* Don't mess with a TARGET_EXPR that hasn't been expanded.
+          It's OK for this to happen if it was part of a subtree that
+          isn't immediately expanded, such as operand 2 of another
+          TARGET_EXPR.  */
+       if (TREE_OPERAND (expr, 1))
+ 	break;
+ 
        TREE_OPERAND (expr, 1) = TREE_OPERAND (expr, 3);
        TREE_OPERAND (expr, 3) = NULL_TREE;
        break;


More information about the Gcc-patches mailing list