home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / gnu / gcc / bug / 2287 < prev    next >
Encoding:
Text File  |  1992-09-08  |  1.2 KB  |  42 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!shasta.stanford.edu!bwilson
  3. From: bwilson@shasta.stanford.edu (Bob Wilson)
  4. Subject: need test for negative constants in output_addr_const()
  5. Message-ID: <9209082109.AA20774@life.ai.mit.edu>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. References: <9209082103.AA21599@mystery.Stanford.EDU>
  9. Distribution: gnu
  10. Date: Tue, 8 Sep 1992 21:09:24 GMT
  11. Approved: bug-gcc@prep.ai.mit.edu
  12. Lines: 28
  13.  
  14. gcc version 2.2.2
  15. configured for mips-dec-ultrix
  16.  
  17. The output_addr_const() function in final.c needs another test for negative
  18. constants.  Without this, an expression like (x - (-2)) is printed as
  19. "x--2", and the MIPS assembler doesn't like that.  Here's a patch:
  20.  
  21. > *** final.c.orig    Tue Sep  8 13:43:56 1992
  22. > --- final.c    Tue Sep  8 13:46:54 1992
  23. > ***************
  24. > *** 2127,2133 ****
  25. >   
  26. >       case MINUS:
  27. >         output_addr_const (file, XEXP (x, 0));
  28. > !       fprintf (file, "-");
  29. >         output_addr_const (file, XEXP (x, 1));
  30. >         break;
  31. >   
  32. > --- 2127,2134 ----
  33. >   
  34. >       case MINUS:
  35. >         output_addr_const (file, XEXP (x, 0));
  36. > !       if (INTVAL (XEXP(x, 1)) >= 0)
  37. > !     fprintf (file, "-");
  38. >         output_addr_const (file, XEXP (x, 1));
  39. >         break;
  40. >   
  41.  
  42.