Patch to fix sibcall v. postincrement

Jason Merrill jason@cygnus.com
Fri Apr 7 10:42:00 GMT 2000


Fixes g++.other/badopt1.C, where we assign the result of a call to an
expression containing a postincrement.  The increment was only being
emitted in one of the alternate call forms, which was not chosen.

2000-04-07  Jason Merrill  <jason@casey.cygnus.com>

	* calls.c (expand_call): emit_queue if we're trying a sibcall.

Index: calls.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/calls.c,v
retrieving revision 1.115
diff -c -p -r1.115 calls.c
*** calls.c	2000/04/05 01:52:54	1.115
--- calls.c	2000/04/07 17:37:51
*************** expand_call (exp, target, ignore)
*** 2264,2269 ****
--- 2264,2273 ----
  	      || ! FUNCTION_OK_FOR_SIBCALL (fndecl))
  	    continue;
  
+ 	  /* Emit any queued insns now; otherwise they would end up in
+              only one of the alternates.  */
+ 	  emit_queue ();
+ 
  	  /* We know at this point that there are not currently any
  	     pending cleanups.  If, however, in the process of evaluating
  	     the arguments we were to create some, we'll need to be


More information about the Gcc-patches mailing list