home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / gcc / bug / 3049 < prev    next >
Encoding:
Internet Message Format  |  1992-12-23  |  4.3 KB

  1. Path: sparky!uunet!olivea!spool.mu.edu!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!watson.ibm.com!c$dje
  2. From: c$dje@watson.ibm.com (David Edelsohn)
  3. Newsgroups: gnu.gcc.bug
  4. Subject: Re: libg++-2.3 build problems under AIX-3.2
  5. Message-ID: <9212231808.AA30099@tweetie.watson.ibm.com>
  6. Date: 23 Dec 92 18:08:25 GMT
  7. Sender: gnulists@ai.mit.edu
  8. Distribution: gnu
  9. Organization: GNUs Not Usenet
  10. Lines: 84
  11. Approved: bug-gcc@prep.ai.mit.edu
  12.  
  13.  
  14.     [Possible gcc backend bug for RS/6000 architecture.  libg++-2.3
  15. does not pass its self-tests (make check) and calls abort because of assert
  16. in libg++/iostream/test/tFile.C:t11().]
  17.  
  18.     I have tracked down the bug in formatted I/O further by comparing
  19. the steps that the Sun version takes versus the RS/6000 version.  For
  20. t11(), cout.form(...), the Sun version calls __outfloat() from
  21. streambuf::vform() with precision=2 and fill=' ' while the RS/6000 version
  22. uses precision=6 and fill=GARBAGE.  fill is set correctly before the call
  23. but is corrupted in the call itself (it is wrong in the called subroutine
  24. itself so this presumably is not a gdb-4.7 bug).  precision is set
  25. differently because the Sun and RS/6000 take slightly different paths
  26. through the code for the '.' case of the format.  The Sun executes:
  27.  
  28.  
  29.                         while (is_digit(ch)) {
  30.                                 n = 10 * n + to_digit(ch);
  31.                                 ch = *fmt++;
  32.                         }
  33.  
  34. but the RS/6000 skips that fragment and proceeds directly to:
  35.  
  36.                         prec = n < 0 ? -1 : n;
  37.                         goto reswitch;
  38.  
  39. so that it ignores the precision specification.  This appears to be an
  40. error in the generated code.  I have not tried to check the assembly output
  41. itself.  As I stated in the original report, I am using gcc-2.3.2 for both
  42. the Sun and RS/6000 tests.  gdb call and traceback information follows.
  43.  
  44.                     David
  45. (Disclaimer: I do not speak for IBM and it does not speak for me.)
  46.  
  47.     Sun call and traceback:
  48.  
  49. __outfloat (value=5.5, sb=0xf7fff150, type=102, width=0, precision=2, flags=0,
  50.     sign_mode=0 '\000', fill=32 ' ') at outfloat.C:31
  51. 31          int count = 0;
  52. (gdb) where
  53. #0  __outfloat (value=5.5, sb=0xf7fff150, type=102, width=0, precision=2,
  54.     flags=0, sign_mode=0 '\000', fill=32 ' ') at outfloat.C:31
  55. #1  0xb8d8 in streambuf::vform (this=0xf7fff150, fmt0=0x0,
  56.     ap=0xf7fff90c "@\031") at sbufvform.C:339
  57. #2  0xb40c in help_vform (sb=0x1a9a4, fmt0=0x4fb0 "%.2f+%.2f = %4.3e\n%n",
  58.     ap=0xf7fff904 "@\026") at sbufvform.C:86
  59. #3  0xb4bc in streambuf::vform (this=0x1a9a4,
  60.     fmt0=0x4fb0 "%.2f+%.2f = %4.3e\n%n", ap=0xf7fff904 "@\026")
  61.     at sbufvform.C:200
  62. #4  0xa6dc in ostream::form (this=0x1a3bc,
  63.     format=0x4fb0 "%.2f+%.2f = %4.3e\n%n") at iostream.C:638
  64. #5  0x5060 in t11 () at tFile.C:423
  65. #6  0x52e0 in main (argc=0, argv=0xf7fffa34) at tFile.C:460
  66. (gdb)
  67.  
  68.     RS/6000 call and traceback:
  69.  
  70. __outfloat (value=5.5, sb=0x2ff7f778, type=102 'f', width=0, precision=6,
  71.     flags=0, sign_mode=0 '\000', fill=536870912) at outfloat.C:31
  72. 31          int count = 0;
  73. (gdb) where
  74. #0  __outfloat (value=5.5, sb=0x2ff7f778, type=102 'f', width=0, precision=6,
  75.     flags=0, sign_mode=0 '\000', fill=536870912) at outfloat.C:31
  76. #1  0x10013270 in streambuf::vform (this=<unknown struct>,
  77.     fmt0=0x10018a58 "%.2f+%.2f = %4.3e\n%n", ap=0x2ff7fa28 "@\031")
  78.     at sbufvform.C:339
  79. #2  0x10012e1c in help_vform (sb=<unknown struct>,
  80.     fmt0=0x10018a58 "%.2f+%.2f = %4.3e\n%n", ap=0x2ff7fa20 "@\026")
  81.     at sbufvform.C:86
  82. #3  0x10012eac in streambuf::vform (this=<unknown struct>,
  83.     fmt0=0x10018a58 "%.2f+%.2f = %4.3e\n%n", ap=0x2ff7fa20 "@\026")
  84.     at sbufvform.C:200
  85. #4  0x10006ed4 in ostream::form (this=0x20051fa4,
  86.     format=0x10018a58 "%.2f+%.2f = %4.3e\n%n") at streambuf.h:5
  87. #5  0x10002a6c in t11 () at tFile.C:423
  88. #6  0x10002c80 in main (argc=1, argv=0x2ff7faf0) at tFile.C:460
  89. #7  0x1000042c in __start ()
  90. (gdb)
  91. ===============================================================================
  92. David Edelsohn                                      T.J. Watson Research Center
  93. c$dje@watson.ibm.com                                P.O. Box 218
  94. +1 914 945 3011 (Tieline 862)                       Yorktown Heights, NY 10598
  95. "The Church doesn't have problems with sex; the world does" -- Vatican official
  96. "A good theory should fit on a T-shirt" -- Astronomer at Jan 1992 AAS meeting
  97.