Article View: gnu.gcc.bug
Article #2021gcc 1.31 generates bad 68020 code when -fforce-addr is used
From: Mark Moraes
Date: Wed, 30 Nov 1988 08:00
Date: Wed, 30 Nov 1988 08:00
75 lines
2663 bytes
2663 bytes
The following file and session illustrate the error - 'as' complains about
illegal operands of the form 'lea sp@-,a0'. These were not present in
gcc 1.30.
Gcc compiled and run on a Sun3/180 running SunOS3.5 - used 'config.gcc
sun3'.
% cat foo.c
typedef unsigned long Mask;
typedef struct _DetailRec { /* Grab details may be bit masks */
unsigned short exact;
Mask *pMask;
} DetailRec;
#define TRUE 1
#define FALSE 0
static int
DetailSupersedesSecond(firstDetail, secondDetail, exception)
DetailRec firstDetail, secondDetail;
unsigned short exception;
{
if (IsInGrabMask(firstDetail, secondDetail, exception))
return TRUE;
if (IdenticalExactDetails(firstDetail.exact, secondDetail.exact, exception))
return TRUE;
return FALSE;
}
% gcc -v -O -S foo.c
gcc version 1.31
/local/lib/gcc-cpp -v -undef -D__GNU__ -D__GNUC__ -Dmc68000 -Dsun -Dunix -D__OPTIMIZE__ -D__HAVE_68881__ -Dmc68020 foo.c /tmp/cca12767.cpp
GNU CPP version 1.31
/local/lib/gcc-cc1 /tmp/cca12767.cpp -quiet -dumpbase foo.c -O -version -o foo.s
GNU C version 1.31 (68k, MIT syntax) compiled by GNU C version 1.31.
% gcc -c -v foo.s
gcc version 1.31
as -mc68020 foo.s -o foo.o
% mv foo.s foo.s.ok
% gcc -v -O -fforce-addr -S foo.c
gcc version 1.31
/local/lib/gcc-cpp -v -undef -D__GNU__ -D__GNUC__ -Dmc68000 -Dsun -Dunix -D__OPTIMIZE__ -D__HAVE_68881__ -Dmc68020 foo.c /tmp/cca12776.cpp
GNU CPP version 1.31
/local/lib/gcc-cc1 /tmp/cca12776.cpp -quiet -dumpbase foo.c -fforce-addr -O -version -o foo.s
GNU C version 1.31 (68k, MIT syntax) compiled by GNU C version 1.31.
% gcc -c -v foo.s
gcc version 1.31
as -mc68020 foo.s -o foo.o
as: error (foo.s:12): Invalid operand
as: error (foo.s:14): Invalid operand
as: error (foo.s:17): Invalid operand
as: error (foo.s:19): Invalid operand
% diff foo.s.ok foo.s
12,13c12,15
< movel a6@(18),sp@-
< movew a6@(16),sp@-
---
> lea sp@-,a0
> movel a6@(18),a0@
> lea sp@-,a0
> movew a6@(16),a0@
15,16c17,20
< movel a6@(10),sp@-
< movew a6@(8),sp@-
---
> lea sp@-,a0
> movel a6@(10),a0@
> lea sp@-,a0
> movew a6@(8),a0@
%
Technical Details
Message-ID:
<88Nov30.030055est.12697@bay.csri.toronto.edu>Path:
arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!uunet!tut.cis.ohio-state.edu!csri.toronto.edu!moraesShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!uunet!tut.cis.ohio-state.edu!csri.toronto.edu!moraes From: moraes@csri.toronto.edu (Mark Moraes) Newsgroups: gnu.gcc.bug Subject: gcc 1.31 generates bad 68020 code when -fforce-addr is used Message-ID: <88Nov30.030055est.12697@bay.csri.toronto.edu> Date: 30 Nov 88 08:00:40 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 74