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: mips/mips.c: Avoid Passing NULL_TREE to host_integerp


2001-01-02  Jeffrey Oldham  <oldham@codesourcery.com>

	* config/mips/mips.c (function_arg): Don't pass NULL_TREE to
	host_integerp.

Tested on	mips-sgi-irix6.5.
Approved by	Mark Mitchell (mark@codesourcery.com).

function_arg()'s "type" can be an incomplete record if the previous
program has syntax errors so all resulting code must be able to handle
this case.  Should code generation be turned off as soon as a syntax
error is detected?

This error was revealed by the testcase g++.pt/crash9.C.

Thanks,
Jeffrey D. Oldham
oldham@codesourcery.com
Index: mips.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mips/mips.c,v
retrieving revision 1.103
diff -c -p -r1.103 mips.c
*** mips.c	2000/11/10 16:01:23	1.103
--- mips.c	2001/01/02 16:07:16
***************
*** 1,6 ****
  /* Subroutines for insn-output.c for MIPS
     Copyright (C) 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998,
!    1999, 2000 Free Software Foundation, Inc.
     Contributed by A. Lichnewsky, lich@inria.inria.fr.
     Changes by Michael Meissner, meissner@osf.org.
     64 bit r4000 support by Ian Lance Taylor, ian@cygnus.com, and
--- 1,6 ----
  /* Subroutines for insn-output.c for MIPS
     Copyright (C) 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998,
!    1999, 2000, 2001 Free Software Foundation, Inc.
     Contributed by A. Lichnewsky, lich@inria.inria.fr.
     Changes by Michael Meissner, meissner@osf.org.
     64 bit r4000 support by Ian Lance Taylor, ian@cygnus.com, and
*************** function_arg (cum, mode, type, named)
*** 4036,4041 ****
--- 4036,4042 ----
  
        if (! type || TREE_CODE (type) != RECORD_TYPE || mips_abi == ABI_32
  	  || mips_abi == ABI_EABI || mips_abi == ABI_O64 || ! named
+ 	  || ! TYPE_SIZE_UNIT (type)
  	  || ! host_integerp (TYPE_SIZE_UNIT (type), 1))
  	ret = gen_rtx_REG (mode, regbase + *arg_words + bias);
        else

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