This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
mips-linux-gnu doesn't use SIZE_TYPE/PTRDIFF_TYPE from mips.h
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: 05 Oct 2002 09:56:15 -0300
- Subject: mips-linux-gnu doesn't use SIZE_TYPE/PTRDIFF_TYPE from mips.h
- Also-resent-to: gcc-patches@gcc.gnu.org
- Organization: GCC Team, Red Hat
It used to be possible to use mips-linux-gnu-gcc for
layout-compatibility tests with mips-sgi-irix6, even for the n32 and
n64 ABIs, but this is not possible at the moment because mips.h
doesn't override the definitions of SIZE_TYPE and PTRDIFF_TYPE from
svr4.h, that appears first in the tm_file list of mips*-*-linux*.
This patch fixes this problem, such that -mabi=n32 and -mabi=64 have
the expect effect in this toolchain, at least as far as compilation of
a preprocessed file goes. Ok to install?
Index: gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* config/mips/mips.h (SIZE_TYPE, PTRDIFF_TYPE): Override
previously definitions.
Index: gcc/config/mips/mips.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mips/mips.h,v
retrieving revision 1.224
diff -u -p -r1.224 mips.h
--- gcc/config/mips/mips.h 1 Oct 2002 10:26:09 -0000 1.224
+++ gcc/config/mips/mips.h 5 Oct 2002 12:51:29 -0000
@@ -4584,15 +4584,14 @@ while (0)
#define MIPS_UNMARK_STAB(code) ((code)-CODE_MASK)
-/* Default definitions for size_t and ptrdiff_t. */
+/* Default definitions for size_t and ptrdiff_t. We must override the
+ definitions from ../svr4.h on mips-*-linux-gnu. */
-#ifndef SIZE_TYPE
+#undef SIZE_TYPE
#define SIZE_TYPE (Pmode == DImode ? "long unsigned int" : "unsigned int")
-#endif
-#ifndef PTRDIFF_TYPE
+#undef PTRDIFF_TYPE
#define PTRDIFF_TYPE (Pmode == DImode ? "long int" : "int")
-#endif
/* See mips_expand_prologue's use of loadgp for when this should be
true. */
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer