GNU C 1.26 (80386) - Yet Another Patch

James Van Artsdalen james at bigtex.uucp
Thu Aug 25 17:02:34 AEST 1988


RMS provided the patch below, which seems to fix all of the serious
bugs I am aware of.  -finline-functions still doesn't work, but that
shouldn't prevent use of the compiler.  If anyone has any *correct*
code that works under cc but not GNU C (with this and the other 1.26
patches I've posted), I'd like to see it: I have no such problems now.
Don't forget to use -traditional and -fwritable-strings when necessary.

I understand some people have the Greenhills C compiler now.  I don't
have mine (so much for the update contract).  I'd be interested in
comparisons.  It would also be interesting to know how it stacks up
against the SCO compiler under Xenix.

I should point out that the GNU folks say that the compiler is still
"beta".  I am encouraging its use because (1) beta or not, it appears
to be a match for cc -O in reliability and (2) a wide test base is
needed to get the glitches out quickly.  If you're brave enough to use
with -O with cc, you ought to try out GNU C.  Otherwise stick to cc.

The patch to reload1.c:

*** /tmp/,RCSt1a23007	Thu Aug 25 01:59:49 1988
--- reload1.c	Wed Aug 24 22:06:35 1988
***************
*** 1256,1261
  {
    register rtx insn;
    register int i;
  
    /* Often (MEM (REG n)) is still valid even if (REG n) is put on the stack.
       Set spill_indirect_ok if so.  */

--- 1256,1262 -----
  {
    register rtx insn;
    register int i;
+   int this_block = 0;
  
    /* Often (MEM (REG n)) is still valid even if (REG n) is put on the stack.
       Set spill_indirect_ok if so.  */
***************
*** 1277,1282
    for (insn = first; insn;)
      {
        register rtx next = NEXT_INSN (insn);
        if (GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN
  	  || GET_CODE (insn) == CALL_INSN)
  	{

--- 1278,1289 -----
    for (insn = first; insn;)
      {
        register rtx next = NEXT_INSN (insn);
+ 
+       /* Notice when we move to a new basic block.  */
+       if (basic_block_needs && this_block + 1 < n_basic_blocks
+ 	  && insn == basic_block_head[this_block+1])
+ 	++this_block;
+ 
        if (GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN
  	  || GET_CODE (insn) == CALL_INSN)
  	{
***************
*** 1291,1296
  
  	  if (n_reloads > 0)
  	    {
  	      /* Now compute which reload regs to reload them into.  Perhaps
  		 reusing reload regs from previous insns, or else output
  		 load insns to reload them.  Maybe output store insns too.

--- 1298,1319 -----
  
  	  if (n_reloads > 0)
  	    {
+ 	      /* If this block has not had spilling done,
+ 		 deactivate any optional reloads lest they
+ 		 try to use a spill-reg which isn't available here.
+ 		 If we have any non-optionals that need a spill reg, abort.  */
+ 	      if (basic_block_needs != 0
+ 		  && basic_block_needs[this_block] == 0)
+ 		{
+ 		  for (i = 0; i < n_reloads; i++)
+ 		    {
+ 		      if (reload_optional[i])
+ 			reload_in[i] = reload_out[i] = 0;
+ 		      else if (reload_reg_rtx[i] == 0)
+ 			abort ();
+ 		    }
+ 		}
+ 
  	      /* Now compute which reload regs to reload them into.  Perhaps
  		 reusing reload regs from previous insns, or else output
  		 load insns to reload them.  Maybe output store insns too.
-- 
James R. Van Artsdalen    ...!uunet!utastro!bigtex!james     "Live Free or Die"
Home: 512-346-2444 Work: 328-0282; 110 Wild Basin Rd. Ste #230, Austin TX 78746



More information about the Comp.unix.microport mailing list