home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / utils / bug / 2289 < prev    next >
Encoding:
Text File  |  1992-12-31  |  2.7 KB  |  91 lines

  1. Newsgroups: gnu.utils.bug
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!dres.dnd.ca!krussell
  3. From: krussell@dres.dnd.ca
  4. Subject: gas-1.38.1 (sparc) incorrectly translating unimp
  5. Message-ID: <199212302105.AA20075@frodo.dres.dnd.ca>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Wed, 30 Dec 1992 07:05:31 GMT
  10. Approved: bug-gnu-utils@prep.ai.mit.edu
  11. Lines: 78
  12.  
  13. gas-1.38.1
  14. SparcStation 2
  15. SunOS 4.1.1
  16.  
  17. I believe I have found a bug in gas-1.38.1 (and perhaps older
  18. versions of gas as well).  If you run into an "Invalid Instruction"
  19. error when executing a program assembled with gas, try patching gas
  20. with the appended patch.  This bug bit me when I attempted to
  21. build "perl-4.035" (I got an error when testing the "dbm" routines).
  22.  
  23. BUG SYNOPSIS
  24. ------------
  25.  
  26.   The "unimp const22" instruction is incorrectly translated in
  27.   some cases.  The Sun-4 Assembly Language Reference Manual states:
  28.  
  29.       UNIMP         unimp   const22       Unimplemented instruction
  30.  
  31.   where gas-1.38.1 implies
  32.  
  33.       UNIMP         unimp   label         Unimplemented instruction
  34.  
  35.   The gas-1.38.1 implementation results in "22 bit PC relative
  36.   immediate" addressing when "unimp n" is translated.  In some
  37.   cases this can cause an "Invalid Instruction" error when the
  38.   assembled program is run.
  39.  
  40.   The appended patch creates a new addressing mode (new for gas)
  41.   called "22 bit Immediate" and instructs gas to use this mode
  42.   when translating "unimp n".
  43.  
  44. BUG FIX
  45. -------
  46.  
  47. diff -Nrc2 gas-1.38.1/sparc-opcode.h gas/sparc-opcode.h
  48. *** gas-1.38.1/sparc-opcode.h    Thu Jun  7 14:22:10 1990
  49. --- gas/sparc-opcode.h    Tue Dec 29 11:14:10 1992
  50. ***************
  51. *** 59,62 ****
  52. --- 59,63 ----
  53.      h    22 high bits.
  54.      i    13 bit Immediate.
  55. +    I    22 bit Immediate.
  56.      l    22 bit PC relative immediate.
  57.      L    30 bit PC relative immediate.
  58. ***************
  59. *** 498,502 ****
  60.   { "tsubcctv",   0x80582000, 0x40a00000, "1,i,d", 0 },
  61.   
  62. ! { "unimp",      0x00000000, 0x00000000, "l", 0 },
  63.   
  64.   { "iflush",     0x81d80000, 0x40202000, "1+2", 0 },
  65. --- 499,503 ----
  66.   { "tsubcctv",   0x80582000, 0x40a00000, "1,i,d", 0 },
  67.   
  68. ! { "unimp",      0x00000000, 0x00000000, "I", 0 },
  69.   
  70.   { "iflush",     0x81d80000, 0x40202000, "1+2", 0 },
  71. diff -Nrc2 gas-1.38.1/sparc.c gas/sparc.c
  72. *** gas-1.38.1/sparc.c    Mon Oct 22 12:04:04 1990
  73. --- gas/sparc.c    Tue Dec 29 11:20:11 1992
  74. ***************
  75. *** 678,681 ****
  76. --- 678,685 ----
  77.           case 'i':   /* 13 bit immediate */
  78.               the_insn.reloc = RELOC_BASE13;
  79. +             goto immediate;
  80. +         case 'I':   /* 22 bit immediate */
  81. +             the_insn.reloc = RELOC_BASE22;
  82.   
  83.           /*FALLTHROUGH*/
  84.  
  85. --
  86.  
  87. Kevin Russell (DND/DRES/DTD/MSS/TDG)                    krussell@dres.dnd.ca
  88. (403) 544-4736     DRE Suffield, Box 4000, Medicine Hat, AB, Canada, T1A 8K6
  89.  
  90.