Article View: gnu.gcc.help
Article #54334Re: GCC'ed programs give memory fault (using COFF patches).
From: Michael Bloom
Date: Wed, 31 Oct 1990 01:01
Date: Wed, 31 Oct 1990 01:01
150 lines
6848 bytes
6848 bytes
In article <JTSILLAS.90Oct29165517@bubba.ma30.bull.com> jtsillas@bubba.ma30.bull.com (James Tsillas) writes:
>I have applied the tut.cs.edu patches to gas-1.36 and gcc-1.37.1 in order
>to produce COFF objects on a DPX/2 using BOS 1.1.16 (a System V based UNIX).
>I used SUN_SYNTAX on the GAS and it seems to be working OK on some smaller
>programs. When I built GCC (using the same patches) I specified sun3-nfp
>as my machine and I edited config/tm-sun3-nfp.h like so:
>Everything built OK and the resulting GCC worked on some smaller programs.
>I then tested GCC on indent-1.1 and the resulting indent gives a memory
>fault with core dump.
I suspect that the problem is in the use of the sun config file which
does not specify returning pointers in register a0. Such a
specification is necessary for most (if not all) System V based 68k
systems. The isinf() hack you quoted does not look so kosher either.
Does the Bull really prepend underscores to symbols? If it does, try
the attached config file. If not, try something that #includes
tm-pbb.h.
Whatever you do, make sure that STRUCTURE_SIZE_BOUNDARY is defined by
either your config file or one that it includes. Otherwise caller
routines compiled with gcc will use a different convention to pass
structures to called routines than the convention that called routines
compiled with gcc will use to reference structures passed to them.
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
# tm-bull-guess.h
# This archive created: Tue Oct 30 16:33:22 1990
export PATH; PATH=/bin:/usr/bin:$PATH
echo shar: "extracting 'tm-bull-guess.h'" '(3745 characters)'
if test -f 'tm-bull-guess.h'
then
echo shar: "will not over-write existing file 'tm-bull-guess.h'"
else
sed 's/^ X//' << \SHAR_EOF > 'tm-bull-guess.h'
X/* Guess for bull */
X
X#include "tm-altos3068.h"
X
X#undef CPP_PREDEFINES
X#define CPP_PREDEFINES "-Dmc68000 -DPORTAR -Dmc68k32 -Uvax -Dm68k -Dunix -DBull_DPX2"
X
X/* FUNCTION_EXTRA_EPILOGUE is not invoked safely for our purposes */
X#undef FUNCTION_EXTRA_EPILOGUE
X
X#undef FUNCTION_FINAL_EXTRA_EPILOGUE
X#define FUNCTION_FINAL_EXTRA_EPILOGUE(FILE, SIZE) \
X{ \
X extern int current_function_returns_pointer; \
X if ((current_function_returns_pointer) \
X fprintf (FILE, "\tmovel d0,a0\n"); \
X}
X
X#define FUNCTION_EPILOGUE(FILE, SIZE) \
X{ register int regno; \
X register int mask, fmask; \
X register int nregs; \
X int offset, foffset, fpoffset; \
X extern char call_used_regs[]; \
X extern int current_function_pops_args; \
X extern int current_function_args_size; \
X int fsize = ((SIZE) + 3) & -4; \
X int big = 0; \
X FUNCTION_EXTRA_EPILOGUE (FILE, SIZE); \
X nregs = 0; fmask = 0; fpoffset = 0; \
X for (regno = 24 ; regno < 56 ; regno++) \
X if (regs_ever_live[regno] && ! call_used_regs[regno]) \
X nregs++; \
X fpoffset = nregs*8; \
X nregs = 0; \
X for (regno = 16; regno < 24; regno++) \
X if (regs_ever_live[regno] && ! call_used_regs[regno]) \
X { nregs++; fmask |= 1 << (23 - regno); } \
X foffset = fpoffset + nregs * 12; \
X nregs = 0; mask = 0; \
X if (frame_pointer_needed) regs_ever_live[FRAME_POINTER_REGNUM] = 0; \
X for (regno = 0; regno < 16; regno++) \
X if (regs_ever_live[regno] && ! call_used_regs[regno]) \
X { nregs++; mask |= 1 << regno; } \
X offset = foffset + nregs * 4; \
X if (offset + fsize >= 0x8000 \
X && frame_pointer_needed \
X && (mask || fmask || fpoffset)) \
X { fprintf (FILE, "\tmovel #%d,a0\n", -fsize); \
X fsize = 0, big = 1; } \
X if (exact_log2 (mask) >= 0) { \
X if (big) \
X fprintf (FILE, "\tmovel a6@(-%d,a0:l),%s\n", \
X offset + fsize, reg_names[exact_log2 (mask)]); \
X else if (! frame_pointer_needed) \
X fprintf (FILE, "\tmovel sp@+,%s\n", \
X reg_names[exact_log2 (mask)]); \
X else \
X fprintf (FILE, "\tmovel a6@(-%d),%s\n", \
X offset + fsize, reg_names[exact_log2 (mask)]); } \
X else if (mask) { \
X if (big) \
X fprintf (FILE, "\tmoveml a6@(-%d,a0:l),#0x%x\n", \
X offset + fsize, mask); \
X else if (! frame_pointer_needed) \
X fprintf (FILE, "\tmoveml sp@+,#0x%x\n", mask); \
X else \
X fprintf (FILE, "\tmoveml a6@(-%d),#0x%x\n", \
X offset + fsize, mask); } \
X if (fmask) { \
X if (big) \
X fprintf (FILE, "\tfmovem a6@(-%d,a0:l),#0x%x\n", \
X foffset + fsize, fmask); \
X else if (! frame_pointer_needed) \
X fprintf (FILE, "\tfmovem sp@+,#0x%x\n", fmask); \
X else \
X fprintf (FILE, "\tfmovem a6@(-%d),#0x%x\n", \
X foffset + fsize, fmask); } \
X if (fpoffset != 0) \
X for (regno = 55; regno >= 24; regno--) \
X if (regs_ever_live[regno] && ! call_used_regs[regno]) { \
X if (big) \
X fprintf(FILE, "\tfpmoved a6@(-%d,a0:l), %s\n", \
X fpoffset + fsize, reg_names[regno]); \
X else if (! frame_pointer_needed) \
X fprintf(FILE, "\tfpmoved sp@+, %s\n", \
X reg_names[regno]); \
X else \
X fprintf(FILE, "\tfpmoved a6@(-%d), %s\n", \
X fpoffset + fsize, reg_names[regno]); \
X fpoffset -= 8; \
X } \
X FUNCTION_FINAL_EXTRA_EPILOGUE (FILE, SIZE); \
X if (frame_pointer_needed) \
X fprintf (FILE, "\tunlk a6\n"); \
X if (current_function_pops_args && current_function_args_size) \
X fprintf (FILE, "\trtd #%d\n", current_function_args_size); \
X else fprintf (FILE, "\trts\n"); }
X
SHAR_EOF
if test 3745 -ne "`wc -c < 'tm-bull-guess.h'`"
then
echo shar: "error transmitting 'tm-bull-guess.h'" '(should have been 3745 characters)'
fi
fi
exit 0
# End of shell archive
Technical Details
Message-ID:
<20896@ttidca.TTI.COM>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!shelby!apple!julius.cs.uiuc.edu!usc!hacgate!ashtate!psivax!ttidca!mbReferences:
<JTSILLAS.90Oct29165517@bubba.ma30.bull.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,710ab1fc6633d5b1 X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1990-10-30 17:01:47 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!shelby!apple!julius.cs.uiuc.edu!usc!hacgate!ashtate!psivax!ttidca!mb From: mb@ttidca.TTI.COM (Michael Bloom) Newsgroups: gnu.gcc.help Subject: Re: GCC'ed programs give memory fault (using COFF patches). Message-ID: <20896@ttidca.TTI.COM> Date: 31 Oct 90 01:01:47 GMT References: <JTSILLAS.90Oct29165517@bubba.ma30.bull.com> Distribution: gnu Organization: Citicorp/TTI, Santa Monica Lines: 150 Posted: Wed Oct 31 02:01:47 1990