Bug using -O2 with cross compiler

Jeffrey A Law law@cygnus.com
Tue Nov 30 23:39:00 GMT 1999


  In message < 199911210403.XAA09480@vlsi-concepts.com >you write:
  > > 1. The dbcc instruction only acts upon the low order 16 bits of the
  > >    specified register.  So, loading an initial value into D0 which
  > >    extends into the upper half of the register is a problem...
  > > 
  > > 2. I'm not quite sure why the compiler generates the instructions at
  > >    locations 416, 418, and 41a...  In fact, don't these instructions
  > >    put this into an infinite loop?  
  > > 
  > >    416: clears D0
  > >    418: subtracts 1 from D0 (leaving 0xffffffff in D0, no carry out)
  > >    41a: branches on carry clear (always) back to the beginning of the
  > >         original loop...
This code deals with the problem mentioned in #1.  Work through it at the
boundary case -- it wipes out the low order bits, does the subtraction in
32bits, then conditionally branches to the top of the loop if neessary.
jeff



More information about the Gcc-bugs mailing list