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 error in stage1 libgcc2.a on mips-sgi-irix6.2


On Apr  3, 2000, "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> wrote:

>> > _eprintf
>> > In file included from ../../egcs-CVS20000328/gcc/tsystem.h:52,
>> >                  from ../../egcs-CVS20000328/gcc/libgcc2.c:35:
>> > include/stdio.h:227: warning: ignoring pragma: 
>> > include/stdio.h:229: warning: ignoring pragma: 
>> > ../../egcs-CVS20000328/gcc/libgcc2.c: In function `__eprintf':
>> > ../../egcs-CVS20000328/gcc/libgcc2.c:1313: Internal compiler error in
>> > 	`expand_call', at calls.c:1916

This is an unexpected consequence of:

Sun Mar 26 11:37:55 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
[snip]
	* config/mips/mips.h (BITS_PER_WORD, UNITS_PER_WORD): Cast to unsigned.

It's used in abi64.s'h RETURN_IN_MEMORY like this:

   : (int_size_in_bytes (TYPE)						\
      > (int)(mips_abi == ABI_EABI ? 2 * UNITS_PER_WORD : 16)))

when TYPE is the void type, int_size_in_bytes returns -1.  However,
because the right-hand expression is unsigned, -1 is converted to
unsigned, the test results true, and so does aggregate_value_p(), so
expand_call() ends up entering the code section that should only be
executed for aggregates, gets struct_value_size set to -1 and
abort()s.

Here's an attempt to fix this bug.  Ok to install?  (assuming it
bootstraps; it will take a long while for it to complete :-(

Index: gcc/ChangeLog
from  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
	
	* config/mips/abi64.h (RETURN_IN_MEMORY): Compare result of
	int_size_in_bytes with a signed integer.
	
Index: gcc/config/mips/abi64.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mips/abi64.h,v
retrieving revision 1.14
diff -u -r1.14 abi64.h
--- gcc/config/mips/abi64.h	2000/03/26 16:46:27	1.14
+++ gcc/config/mips/abi64.h	2000/04/05 05:39:46
@@ -1,5 +1,5 @@
 /* Definitions of target machine for GNU compiler.  64 bit ABI support.
-   Copyright (C) 1994, 1995, 1996, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -91,7 +91,7 @@
   ((mips_abi == ABI_32 || mips_abi == ABI_O64)				\
    ? TYPE_MODE (TYPE) == BLKmode					\
    : (int_size_in_bytes (TYPE)						\
-      > (mips_abi == ABI_EABI ? 2 * UNITS_PER_WORD : 16)))
+      > (int)(mips_abi == ABI_EABI ? 2 * UNITS_PER_WORD : 16)))
 
 #ifdef ANSI_PROTOTYPES
 union tree_node;

-- 
Alexandre Oliva    Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me

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