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

Re: Bootstrap failure on ia32


On Mon, Feb 19, 2001 at 05:02:31PM +0100, Andreas Jaeger wrote:
> 
> After today's patches by Richard and Jan bootstrap on i686-linux fails
> on the mainline branch:
> 
> stage1/xgcc -Bstage1/ -B/opt/gcc-2.97.test/i686-pc-linux-gnu/bin/ -c  -DIN_GCC    -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long  -DHAVE_CONFIG_H -DGENERATOR_FILE    -I. -I. -I/cvs/gcc/gcc -I/cvs/gcc/gcc/. -I/cvs/gcc/gcc/config -I/cvs/gcc/gcc/../include /cvs/gcc/gcc/gensupport.c
> /cvs/gcc/gcc/gensupport.c: In function `init_md_reader':
> /cvs/gcc/gcc/gensupport.c:807: Internal error: Segmentation fault
> Please submit a full bug report, with preprocessed source if appropriate.
> See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
> make[2]: *** [gensupport.o] Error 1

This is caused by failure to check the return from
identify_call_return_value, which leads to dereferencing garbage
pointers in skip_copy_to_return_value.  I believe this is the correct
patch; it has gotten past the above point in a test build, anyway.

I haven't been able to bootstrap the mainline for about a week, now.
This is extremely irritating.

zw

	* sibcall.c (skip_copy_to_return_value): Call
	identify_call_return_value here, and return orig_insn if it
	returns zero.  Hardret and softret arguments now unnecessary.
	(call_ends_block_p): Don't call identify_call_return_value
	here.

===================================================================
Index: sibcall.c
--- sibcall.c	2001/02/19 14:42:55	1.13
+++ sibcall.c	2001/02/19 18:10:49
@@ -33,7 +33,7 @@ Boston, MA 02111-1307, USA.  */
 #include "except.h"
 
 static int identify_call_return_value	PARAMS ((rtx, rtx *, rtx *));
-static rtx skip_copy_to_return_value	PARAMS ((rtx, rtx, rtx));
+static rtx skip_copy_to_return_value	PARAMS ((rtx));
 static rtx skip_use_of_return_value	PARAMS ((rtx, enum rtx_code));
 static rtx skip_stack_adjustment	PARAMS ((rtx));
 static rtx skip_pic_restore		PARAMS ((rtx));
@@ -133,11 +133,15 @@ identify_call_return_value (cp, p_hard_r
    copy.  Otherwise return ORIG_INSN.  */
 
 static rtx
-skip_copy_to_return_value (orig_insn, hardret, softret)
+skip_copy_to_return_value (orig_insn)
      rtx orig_insn;
-     rtx hardret, softret;
 {
   rtx insn, set = NULL_RTX;
+  rtx hardret, softret;
+
+  /* If there is no return value, we have nothing to do.  */
+  if (! identify_call_return_value (PATTERN (orig_insn), &hardret, &softret))
+    return orig_insn;
 
   insn = next_nonnote_insn (orig_insn);
   if (! insn)
@@ -265,8 +269,6 @@ call_ends_block_p (insn, end)
      rtx insn;
      rtx end;
 {
-  rtx hardret, softret;
-
   /* END might be a note, so get the last nonnote insn of the block.  */
   end = next_nonnote_insn (PREV_INSN (end));
 
@@ -277,8 +279,7 @@ call_ends_block_p (insn, end)
   /* Skip over copying from the call's return value pseudo into
      this function's hard return register and if that's the end
      of the block, we're OK.  */
-  identify_call_return_value (PATTERN (insn), &hardret, &softret);
-  insn = skip_copy_to_return_value (insn, hardret, softret);
+  insn = skip_copy_to_return_value (insn);
   if (insn == end)
     return 1;
 




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