Article View: gnu.gcc.bug
Article #1093need test for negative constants in output_addr_const()
From: Bob Wilson
Date: Tue, 08 Sep 1992 21:09
Date: Tue, 08 Sep 1992 21:09
27 lines
1295 bytes
1295 bytes
gcc version 2.2.2 configured for mips-dec-ultrix The output_addr_const() function in final.c needs another test for negative constants. Without this, an expression like (x - (-2)) is printed as "x--2", and the MIPS assembler doesn't like that. Here's a patch: > *** final.c.orig Tue Sep 8 13:43:56 1992 > --- final.c Tue Sep 8 13:46:54 1992 > *************** > *** 2127,2133 **** > > case MINUS: > output_addr_const (file, XEXP (x, 0)); > ! fprintf (file, "-"); > output_addr_const (file, XEXP (x, 1)); > break; > > --- 2127,2134 ---- > > case MINUS: > output_addr_const (file, XEXP (x, 0)); > ! if (INTVAL (XEXP(x, 1)) >= 0) > ! fprintf (file, "-"); > output_addr_const (file, XEXP (x, 1)); > break; >
Technical Details
Message-ID:
<9209082109.AA20774@life.ai.mit.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!shasta.stanford.edu!bwilsonReferences:
<9209082103.AA21599@mystery.Stanford.EDU>Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!shasta.stanford.edu!bwilson From: bwilson@shasta.stanford.edu (Bob Wilson) Subject: need test for negative constants in output_addr_const() Message-ID: <9209082109.AA20774@life.ai.mit.edu> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet References: <9209082103.AA21599@mystery.Stanford.EDU> Distribution: gnu Date: Tue, 8 Sep 1992 21:09:24 GMT Approved: bug-gcc@prep.ai.mit.edu Lines: 28