home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / gnu / gcc / bug / 2199 < prev    next >
Encoding:
Text File  |  1992-08-27  |  3.0 KB  |  97 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!orthogo.UUCP!basti
  3. From: basti@orthogo.UUCP (Sebastian Wangnick)
  4. Subject: Two bugs within gcc-2.2.2
  5. Message-ID: <9208271421.AA07068@orthogo.uucp>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Thu, 27 Aug 1992 18:21:17 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 84
  12.  
  13. I just reinstalled gcc-2.2.2 on our RS6000 (configured rs6000-ibm-aix) and
  14. stumbled again over this damn bug within __builtin_new of libgcc2.c:
  15. Allocating e.g., new int[0], fires the new_handler! I patched this with:
  16.  
  17. *** libgcc2.c  Thu Aug 27 15:46:30 1992
  18. --- /tmp/lc Thu Aug 27 15:54:20 1992
  19. ***************
  20. *** 969,975 ****
  21.   {
  22.     void *p;
  23.     p = malloc (sz);
  24. !   if (p == 0 && sz)
  25.       (*__new_handler) ();
  26.     return p;
  27.   }
  28. --- 969,975 ----
  29.   {
  30.     void *p;
  31.     p = malloc (sz);
  32. !   if (p == 0)
  33.       (*__new_handler) ();
  34.     return p;
  35.   }
  36.  
  37.  
  38. Another issue is that using -pg makes the assembler complain (at least in 
  39. AIX 3.2 with the patch you mention in RS6000.README installed): Compiling 
  40. the following program
  41.  
  42.     int main () {return 0;}
  43.  
  44. with
  45.     gcc -pg -v -c minimal.C
  46.  
  47. leads to:
  48. Reading specs from /usr/local/lib/gcc-lib/rs6000-ibm-aix/2.2.2/specs
  49. gcc version 2.2.2
  50.  /usr/local/lib/gcc-lib/rs6000-ibm-aix/2.2.2/cpp -lang-c++ -v -undef -D__GNUC__=
  51. 2 -D__GNUG__=2 -D__cplusplus -D_IBMR2 -D_AIX -D___IBMR2__ -D___AIX__ -D___IBMR2
  52. -D___AIX -D__CHAR_UNSIGNED__ minimal.C /tmp/ccWcMDM2.i
  53. GNU CPP version 2.2.2
  54.  /usr/local/lib/gcc-lib/rs6000-ibm-aix/2.2.2/cc1plus /tmp/ccWcMDM2.i -quiet -dum
  55. pbase minimal.cc -version -p -o /tmp/ccWcMDM2.s
  56. GNU C++ version 2.2.2 compiled by GNU C version 2.2.2.
  57.  as -o minimal.o /tmp/ccWcMDM2.s
  58. Assembler:
  59. /tmp/ccWcMDM2.s: line 1: Invalid toc entry within .toc scope
  60. /tmp/ccWcMDM2.s: line 24: Invalid toc entry within .toc scope
  61. /tmp/ccWcMDM2.s: line 30: undefined symbol ".mcount"
  62. /tmp/ccWcMDM2.s: line 30: illegal expression type for branch address
  63.  
  64. I overcame this with the following patch to toplev.c (not knowing what it will 
  65. do to other architectures):
  66.  
  67. *** toplev.c    Thu Aug 27 10:13:04 1992
  68. --- toplev.c.orig       Thu May 28 07:36:37 1992
  69. ***************
  70. *** 1609,1615 ****
  71.     if (profile_flag || profile_block_flag)
  72. !     {
  73. !       text_section ();
  74. !       ASM_OUTPUT_SKIP(asm_out_file,UNITS_PER_WORD);
  75. !       assemble_external_libcall(gen_rtx(SYMBOL_REF,Pmode,"mcount"));
  76. !     }
  77.  
  78. --- 1609,1611 ----
  79.     if (profile_flag || profile_block_flag)
  80. !     assemble_zeros (UNITS_PER_WORD);
  81.  
  82.  
  83. The problem is: I still cannot profile, since ld only has 65536 or so TOC
  84. entries available, and my program (lots of C++) needs 101700 when profiled!
  85. I suppose TOC information is doubled when profiled, so making my code a little
  86. bit bigger will trigger the border even WITHOUT profiling! No FP constants,
  87. only function definitions! So, PLEASE, devise a different scheme or tell IBM
  88. to lift that border.
  89.  
  90. So long,
  91.  
  92. Sebastian Wangnick   Orthogon System GmbH
  93. (basti@orthogo.uucp) Linzer Strasse 4
  94. Tel +49 421 219136   D-2800 Bremen 33
  95. Fax +49 421 213093   Germany
  96.  
  97.