Patch for warnings on mips-irix6

Richard Sandiford r.sandiford@redhat.com
Fri Aug 31 11:06:00 GMT 2001


"Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> writes:
> > From: Richard Henderson <rth@redhat.com>
> > On Sun, Aug 26, 2001 at 10:51:19PM -0400, Kaveh R. Ghazi wrote:
> > > Pay special attention to the uninitialized warning from mips.c.  That
> > > variable appeared truly uninitialized and I totally guessed at what
> > > the right init value should be when I found the clause where it wasn't
> > > given a value.

Aggh, thanks for catching this.

> > Looks like the bug is that we should have
> > 
> > -   mips_emit_frame_related_store (mem_rtx, reg_rtx, gp_offset);
> > +   mips_emit_frame_related_store (mem_rtx, reg_rtx, base_offset);
> > 
> > the gp, so the offset to the gp stack slot is meaningless.

There are two such statements in save_restore_insns: the first should
pass gp_offset and the second should pass fp_offset.  Both passed
gp_offset before Kaveh's patch.

I didn't catch this when running the testsuite because at that time all
EH tests on mips-elf failed (__register_frame_info wasn't being called).
Trying again now, I get this error when trying to produce an executable:

/foo/libgloss/mips/crt0.o: In function `init':
/foo/libgloss/mips/crt0.S:184: undefined reference to `__do_global_dtors'
/foo/libgloss/mips/crt0.S:184: undefined reference to `__do_global_dtors'
collect2: ld returned 1 exit status

I guess libgloss needs to be updated wrt the recent crtstuff changes, but
I don't know what that involves.

FWIW, I originally developed the patch on a local tree, without the
typo, and saw no regressions.  EH was working fine on that tree.  But I
had to alter the patch slightly before it would apply cleanly to CVS
sources, which is when I ran into the EH problem.

Seeing as I can't test mips-elf now, is it OK to commit this patch as
obvious?  Or should I revert my original one?

Richard


	* config/mips/mips.c (save_restore_insns): Change base_offset to
	fp_offset in second call to mips_emit_frame_related_store.

Index: mips.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.c,v
retrieving revision 1.144
diff -u -p -d -r1.144 mips.c
--- mips.c	2001/08/29 11:45:13	1.144
+++ mips.c	2001/08/31 12:34:49
@@ -6782,7 +6782,7 @@ save_restore_insns (store_p, large_reg, 
 		RTX_UNCHANGING_P (mem_rtx) = 1;
 
 		if (store_p)
-		  mips_emit_frame_related_store (mem_rtx, reg_rtx, base_offset);
+		  mips_emit_frame_related_store (mem_rtx, reg_rtx, fp_offset);
 		else
 		  emit_move_insn (reg_rtx, mem_rtx);
 	      }



More information about the Gcc-patches mailing list