From:	CRDGW2::CRDGW2::MRGATE::"SMTP::PREP.AI.MIT.EDU::HELP-GCC-REQUEST" 27-FEB-1992 04:13:50.94
To:	ARISIA::EVERHART
CC:	
Subj:	Serious GCC 2.0 bugs

From:	help-gcc-request@prep.ai.mit.edu@SMTP@CRDGW2
To:	Everhart@Arisia@MRGATE

Received:  by crdgw1.ge.com (5.57/GE 1.123)
	 id AA09176; Thu, 27 Feb 92 03:40:06 EST
Received: by life.ai.mit.edu (4.1/AI-4.10) id AA22952; Wed, 26 Feb 92 06:37:20 EST
Return-Path: <kenner@vlsi1.ultra.nyu.edu>
Received: from vlsi1.ultra.nyu.edu by life.ai.mit.edu (4.1/AI-4.10) id AA22929; Wed, 26 Feb 92 06:36:59 EST
Received: by vlsi1.ultra.nyu.edu (5.61/1.34)
	id AA11776; Wed, 26 Feb 92 06:32:46 -0500
Date: Wed, 26 Feb 92 06:32:46 -0500
From: kenner@vlsi1.ultra.nyu.edu (Richard Kenner)
Message-Id: <9202261132.AA11776@vlsi1.ultra.nyu.edu>
To: bug-gcc@prep.ai.mit.edu, help-gcc@prep.ai.mit.edu
Subject: Serious GCC 2.0 bugs

We have recently been made aware of two serious GCC 2.0 bugs.  The
first causes comparison failures when bootstrapping on the Sparc
(usually in cccp.o).  This bug was caused by a missed optimization
that very rarely was not missed.  Whether it was missed or not
depended on the address of something.  The stage1 and stage2 compilers
differered on whether they did the optimization or not.  This bug does
not cause any incorrect code to be generated or the compiler to abort, but
will cause bootstrap failures.  The patch to cse.c below fixes
this problem.

There is another bug that can cause the compiler to get a SIGSEGV when
compiling an empty function.  The fix to global-alloc.c below corrects
that problem.

*** cse.c.feb26	Wed Feb 26 05:42:03 1992
--- cse.c	Wed Feb 26 05:46:18 1992
*************** fold_rtx (x, insn)
*** 4734,4737 ****
--- 4734,4745 ----
        break;
  
+     case 'o':
+       /* (lo_sum (high X) X) is simply X.  */
+       if (code == LO_SUM && const_arg0 != 0
+ 	  && GET_CODE (const_arg0) == HIGH
+ 	  && rtx_equal_p (XEXP (const_arg0, 0), const_arg1))
+ 	return const_arg1;
+       break;
+ 
      case '3':
*** global-alloc.c.old	Mon Feb 17 21:16:59 1992
--- global-alloc.c	Tue Feb 25 21:43:17 1992
*************** global_alloc (file)
*** 543,547 ****
    if (n_basic_blocks > 0)
  #endif
!     reload (basic_block_head[0], 1, file);
  }
  
--- 543,547 ----
    if (n_basic_blocks > 0)
  #endif
!     reload (get_insns (), 1, file);
  }
  
