Bug in sparc.md

Martin Ohmacht ohmacht@mst.uni-hannover.de
Wed Nov 22 09:46:00 GMT 2000


The sparc machine description has a severe bug. For the addsi3, the
constraints allow two immediate operands as inputs. If the second is
const_int 4096, the insn is emitted as a subtraction by -4096. The
subtraction disallows an immediate operand as first operand, so the sub
insn isn't recognized and the compiler aborts.
The bug appeared when compiling pine 4.30 with gcc 2.95.2 on a Sparc
Solaris  2.7 (32 bit mode) in module mbx.c. I added the mbx.i. The
compiler crashes  when compiling line 9331:
  if (((MBXLOCAL *) stream->local) ->buflen < (4096  + 4 )) {
                                               ^^^^^^^^^
I solved the problem using the small patch attached to this mail.

Regards,
Martin

Martin Ohmacht                     Mikroelektronische Schaltungstechnik
mailto:ohmacht@mst.uni-hannover.de                 Universität Hannover
http://www.mst.uni-hannover.de/~ohmacht                         Germany


More information about the Gcc-bugs mailing list