This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Catch emit_library_call being called with a NULL parameter
- To: gcc-patches at gcc dot gnu dot org
- Subject: Catch emit_library_call being called with a NULL parameter
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Wed, 8 Mar 2000 17:50:31 -0800
Hi Guys,
Due to a bug in another bit of code, I ended up with
emit_library_call() being called with one of the parameters to the
library call being NULL_RTX, which resulted in gcc generating a seg
fault. The patch below is just a tiny fix to make gcc abort
instead, producing slightly nicer behaviour from the compiler.
OK to apply ?
Cheers
Nick
2000-03-08 Nick Clifton <nickc@cygnus.com>
* calls.c (emit_library_calls): Abort if any of the call's
arguments are null.
Index: gcc/calls.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/calls.c,v
retrieving revision 1.90
diff -p -r1.90 calls.c
*** calls.c 2000/03/07 11:41:17 1.90
--- calls.c 2000/03/09 01:46:42
*************** emit_library_call VPARAMS((rtx orgfun, i
*** 2780,2785 ****
--- 2780,2786 ----
/* We cannot convert the arg value to the mode the library wants here;
must do it earlier where we know the signedness of the arg. */
if (mode == BLKmode
+ || val == NULL_RTX
|| (GET_MODE (val) != mode && GET_MODE (val) != VOIDmode))
abort ();