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]

PATCH for ICE with CVS egcs-2.92.13 on m68k-motorola-sysv


On Wed, 7 October 1998, 15:53:51, manfred@s-direktnet.de wrote:

 > This happened during "make bootstrap" on m68k-motorola-sysv (aka "delta")
 > while compiling libgcc2.c with the just built stage1 compiler:
 > 
 >   ./xgcc -B./ -O2   -DIN_GCC    -g -I./include  -DUSE_GAS -g1  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED    -I. -I../../egcs-19981006/gcc -I../../egcs-19981006/gcc/config -I../../egcs-19981006/gcc/../include -c -DL${name} \
 >       ../../egcs-19981006/gcc/libgcc2.c -o ${name}.o; \
 >   if [ $? -eq 0 ] ; then true; else exit 1; fi; \
 >   ar rc tmplibgcc2.a ${name}.o; \
 >   rm -f ${name}.o; \
 > done
 > _muldi3
 > xgcc: Internal compiler error: program cc1 got fatal signal 11
 > 
 > I've  attached a stack backtrace from  inside gdb and the preprocessed
 > libgcc2.i.gz.    The   backtrace shows,  that    "free" is called from
 > "reload"   with a NULL pointer;  somehow,  reload1.c is looking rather
 > strange here:
 > 
 >   /* Indicate that we no longer have known memory locations or constants.  */
 >   reg_equiv_constant = 0;
 >   reg_equiv_memory_loc = 0;
 > 
 >   if (real_known_ptr)
 >     free (real_known_ptr);
 >   if (real_at_ptr)
 >     free (real_at_ptr);
 > 
 > ->  free (reg_equiv_constant);
 >   free (reg_equiv_memory_loc);
 > 
 > Please note, some lines above "reg_equiv_constant" has  been set to 0,
 > so why is "free" called here?  One fix would be to simply drop the two
 > offending calls to "free", but I'm not sure if that's correct.

I just applied this patch and now at least *this* error is gone ;-)

1998-10-07  Manfred Hollstein  <manfred@s-direktnet.de>

	* reload1.c (reload): Call free before clobbering the memory
	locations or constants pointers.

diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19981006.orig/gcc/reload1.c egcs-19981006/gcc/reload1.c
--- egcs-19981006.orig/gcc/reload1.c	Tue Oct  6 11:36:11 1998
+++ egcs-19981006/gcc/reload1.c	Wed Oct  7 16:00:06 1998
@@ -1260,7 +1260,11 @@ reload (first, global, dumpfile)
   obstack_free (&reload_obstack, reload_startobj);
 
   /* Indicate that we no longer have known memory locations or constants.  */
+  if (reg_equiv_constant)
+    free (reg_equiv_constant);
   reg_equiv_constant = 0;
+  if (reg_equiv_memory_loc)
+    free (reg_equiv_memory_loc);
   reg_equiv_memory_loc = 0;
 
   if (real_known_ptr)
@@ -1268,8 +1272,6 @@ reload (first, global, dumpfile)
   if (real_at_ptr)
     free (real_at_ptr);
 
-  free (reg_equiv_constant);
-  free (reg_equiv_memory_loc);
   free (reg_equiv_mem);
   free (reg_equiv_init);
   free (reg_equiv_address);


manfred


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