From nobody@FreeBSD.ORG Mon Mar 22 19:59:56 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 6CC1E14C14; Mon, 22 Mar 1999 19:59:56 -0800 (PST)
Message-Id: <19990323035956.6CC1E14C14@hub.freebsd.org>
Date: Mon, 22 Mar 1999 19:59:56 -0800 (PST)
From: eischen@vigrid.com
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: Fatal GCC error
X-Send-Pr-Version: www-1.0

>Number:         10740
>Category:       gnu
>Synopsis:       Fatal GCC error
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 22 20:00:01 PST 1999
>Closed-Date:    Thu Jul 22 14:27:44 PDT 1999
>Last-Modified:  Thu Jul 22 14:28:46 PDT 1999
>Originator:     Daniel Eischen
>Release:        4.0-current
>Organization:
>Environment:
FreeBSD antares 4.0-CURRENT FreeBSD 4.0-CURRENT #0: Mon Feb 22 20:03:32 EST 1999     deischen@antares:/opt/src/src/sys/compile/antares  i386

>Description:
I found something that causes a fatal GCC bug with both the stock
GCC, and gcc-2.8.1 built from ports.  Here's how it aborts:

  cc -c -O -pipe -DFREEBSD_ELF     -I. -I. -I./config -DHAVE_CONFIG_H \
   -I./../include/opcode -I./../readline  -I../bfd -I./../bfd  -I./../include \
   ada-lang.c
  ada-lang.c: In function `ada_evaluate_subexp':
  ada-lang.c:5951: internal error--insn does not satisfy its constraints:
  (insn 2997 2996 4542 (parallel[ 
              (set (reg:DI 1 %edx)
                  (minus:DI (reg:DI 0 %eax)
                      (reg/v:DI 3 %ebx)))
              (clobber (scratch:SI))
          ] ) 135 {subdi3} (insn_list 2982 (insn_list 2994 (nil)))
      (expr_list:REG_DEAD (mem:DI (plus:SI (reg:SI 6 %ebp)
                  (const_int -64)))
          (expr_list:REG_DEAD (reg/v:DI 3 %ebx)
              (expr_list:REG_UNUSED (scratch:SI)
                  (nil)))))
  cc: Internal compiler error: program cc1 got fatal signal 6
  *** Error code 1

>How-To-Repeat:
This can be reproduced by building the Ada-aware GDB port found at:

  ftp://ftp.pcnet.com/users/eischen/FreeBSD/adagdb-4.17-port.tar.gz

and building with 'make EXPOSE_FATAL_GCC_ERROR=yes'.  If you
don't define EXPOSE_FATAL_GCC_ERROR, a work-around patch is
applied and the port successfully builds.

>Fix:
I don't know how to fix GCC, but a work-around to the bug can
be made by changing 2 ocurrences of the following line:

      (*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);

in ada-lang.c to

      (*pos) = (*pos) + 3 + BYTES_TO_EXP_ELEM (tem + 1);


>Release-Note:
>Audit-Trail:

From: Tim Vanderhoek <vanderh@ecf.utoronto.ca>
To: Daniel Eischen <eischen@vigrid.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: gnu/10740
Date: Thu, 22 Jul 1999 05:12:36 -0400

 On Mon, Jun 21, 1999 at 03:56:23PM -0400, Daniel Eischen wrote:
 > >
 > > Have you reported this to the GNU maintainers?
 > 
 > No, I wasn't sure if it was a bug that FreeBSD introduced with
 > it's mods to gcc or not.  Now that we're at egcs, perhaps I'll
 > try to reproduce the problem again.
 
 There's probably not much we can do with the bug, esp. given that it
 appears in the gcc port which has fewer FreeBSD-specific patches...
 
 
 -- 
 This is my .signature which gets appended to the end of my messages.
 

From: Daniel Eischen <eischen@vigrid.com>
To: eischen@vigrid.com, vanderh@ecf.utoronto.ca
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: gnu/10740
Date: Thu, 22 Jul 1999 06:06:11 -0400 (EDT)

 Tim Vanderhoek wrote:
 > On Mon, Jun 21, 1999 at 03:56:23PM -0400, Daniel Eischen wrote:
 > > >
 > > > Have you reported this to the GNU maintainers?
 > > 
 > > No, I wasn't sure if it was a bug that FreeBSD introduced with
 > > it's mods to gcc or not.  Now that we're at egcs, perhaps I'll
 > > try to reproduce the problem again.
 > 
 > There's probably not much we can do with the bug, esp. given that it
 > appears in the gcc port which has fewer FreeBSD-specific patches...
 
 OK, why don't you close it out then.  If I can reproduce it under
 egcs, I'll report it to the GNU folks.
 
 Dan Eischen
 eischen@vigrid.com
 
State-Changed-From-To: open->closed 
State-Changed-By: hoek 
State-Changed-When: Thu Jul 22 14:27:44 PDT 1999 
State-Changed-Why:  
Originator will be reporting bug to the GNU folks if it reproduces unter 
(s/unter/under/) their latest. 
>Unformatted:
