home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.gcc.bug
- Path: 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
-
- 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;
- >
-
-