This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: mips-elf/rtems and binutils 2.13.1pre1


On Thu, Nov 07, 2002 at 08:14:22AM -0600, Joel Sherrill wrote:
> 
> 
> Ralf Corsepius wrote:
> > 
> > Am Mit, 2002-11-06 um 22.28 schrieb Ralf Corsepius:
> > > Am Mit, 2002-11-06 um 21.05 schrieb Daniel Jacobowitz:
> > > > On Wed, Nov 06, 2002 at 01:54:47PM -0600, Joel Sherrill wrote:
> > > > >
> > 
> > > > > I am trying to compile all the RTEMS source for all targets using
> > > > > binutils 2.13.1 pre1 and got this new error:
> > > > >
> > > > > mips-rtems-gcc --pipe -isystem ../../../../../p4600/lib/include
> > > > > -D_COMPILING_BSD_KERNEL_ -DKERNEL -DINET -DNFS -DDIAGNOSTIC
> > > > > -DBOOTP_COMPAT      -O4 -fomit-frame-pointer -g -Wall -mips3 -G0  -o
> > > > > o-optimize/in_pcb.o -c
> > > > > ../../../../../../../current/c/src/../../cpukit/libnetworking/netinet/in_pcb.c
> > > > > {standard input}: Assembler messages:
> > > > > {standard input}:1884: Error: illegal operands `sd 0,112($sp)'
> > I am able to reproduce the bug with the code fragment below (reduced
> > from the original code which produced the error above):
> > 
> > # cat in_pcb.c
> > struct in_addr {
> >         unsigned long s_addr  __attribute__((packed)) ;
> > };
> > 
> > void
> > in_pcbnotify( struct in_addr laddr )
> > {
> >                 laddr.s_addr = 0;
> > }
> > 
> > With binutils-2.13/gcc-3.2, the error occurs if compiling this fragment
> > for mips-rtems with -O >= 1 and -mips3
> > 
> > # mips-rtems-gcc -O1 -mips3 -o o-optimize/in_pcb.o in_pcb.c
> > /tmp/ccfoPmP7.s: Assembler messages:
> > /tmp/ccfoPmP7.s:13: Error: illegal operands `sd 0,0($sp)'
> > 
> > The error does not occur if not using -mips3 or using -O0, or if having
> > removed the __attribute__((packed)) from of the code fragment above.
> 
> Since Daniel has stated that gas is correctly rejecting invalid
> assembly,
> then the conclusion must be that it is a code generation problem in
> gcc.  
> 
> Ralf, unless Daniel disagrees, this is a gcc bug which needs to be 
> filed as a GCC GNATS PR.  Please file it and add me as an interested
> party.

I'll do you one better.  Look in mips.md for this code, around line
4880:
  /* The stack/frame pointers are always aligned, so we can convert
     to the faster sw if we are referencing an aligned stack location.  */

  if ((INTVAL (offset) & 7) == 0
      && (mem_addr == stack_pointer_rtx || mem_addr == frame_pointer_rtx))
    return \"sd\\t%1,%0\";

  return \"usd\\t%z1,%0\";
}"

See the difference between the usd and the sd?  Try changing %1 to %z1
in the sd and running your test again.

I swear I've fixed this problem at least four times now.  Eric,
shouldn't all store patters be using %z1?  I guess the last time this
was fixed we only got the 32-bit stores.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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