From steve@sse0691.bri.hp.com  Mon Sep  4 06:59:50 2000
Return-Path: <steve@sse0691.bri.hp.com>
Received: from bbnrel4.net.external.hp.com (bbnrel4.net.external.hp.com [155.208.254.68])
	by hub.freebsd.org (Postfix) with ESMTP id A04E437B424
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  4 Sep 2000 06:59:50 -0700 (PDT)
Received: from hpcpbla.bri.hp.com (hpcpbla.bri.hp.com [15.144.112.65])
	by bbnrel4.net.external.hp.com (Postfix) with ESMTP id 8E62F15233
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  4 Sep 2000 15:59:48 +0200 (METDST)
Received: from sse0691.bri.hp.com (sse0691.bri.hp.com [15.144.0.53])
	by hpcpbla.bri.hp.com (8.9.3 (PHNE_18979)/8.9.3 SMKit7.0) with ESMTP id OAA29277
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 4 Sep 2000 14:59:47 +0100 (BST)
Received: (from steve@localhost)
	by sse0691.bri.hp.com (8.9.3/8.9.3) id PAA15125;
	Mon, 4 Sep 2000 15:02:45 +0100 (BST)
	(envelope-from steve)
Message-Id: <200009041402.PAA15125@sse0691.bri.hp.com>
Date: Mon, 4 Sep 2000 15:02:45 +0100 (BST)
From: Steve Roome <steve@sse0691.bri.hp.com>
Reply-To: steve@sse0691.bri.hp.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: gcc bug with -mno-ieee-fp and -march=pentiumpro
X-Send-Pr-Version: 3.2

>Number:         21026
>Category:       gnu
>Synopsis:       gcc bug with -mno-ieee-fp and -march=pentiumpro
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    obrien
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 04 07:00:08 PDT 2000
>Closed-Date:    Fri Nov 10 22:18:27 PST 2000
>Last-Modified:  Fri Nov 10 22:19:16 PST 2000
>Originator:     Steve Roome
>Release:        FreeBSD 4.1-STABLE i386
>Organization:
>Environment:

	4.1-stable
	gcc version 2.95.2 19991024 (release)

>Description:

	compiling code with -mno-ieee-fp and -march=pentiumpro
	cause cc1 to die with sig11 on comparison between float
	and integer

	e.g.
	gcc -mno-ieee-fp -march=pentiumpro -c particlesys.c -o particlesys.o
	gcc: Internal compiler error: program cc1 got fatal signal 11
	*** Error code 1

>How-To-Repeat:

	int main() {
        	double xv=0.2;
	        return (xv>0);
	}

	try to compile the above with -mno-ieee-fp and -march=pentiumpro
	
>Fix:

	


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->obrien 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Mon Sep 4 08:04:45 PDT 2000 
Responsible-Changed-Why:  
The problem exists in 5.0-CURRENT as well.  Over to the 
maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=21026 
State-Changed-From-To: open->feedback 
State-Changed-By: sheldonh 
State-Changed-When: Mon Sep 4 08:05:16 PDT 2000 
State-Changed-Why:  
David will probably want to know whether the problem exists 
in stock gcc without FreeBSD's modifications.  Can you test 
this out and provide feedback in the form of an e-mail 
message sent to <freebsd-gnats-submit@FreeBSD.org> with 
the subject line of this message? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=21026 

From: Steve Price <sprice@hiwaay.net>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: gnu/21026
Date: Tue, 5 Sep 2000 08:58:52 -0500

 On Mon, Sep 04, 2000 at 08:06:26AM -0700, sheldonh@FreeBSD.org wrote:
 > Synopsis: gcc bug with -mno-ieee-fp and -march=pentiumpro
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: sheldonh
 > State-Changed-When: Mon Sep 4 08:05:16 PDT 2000
 > State-Changed-Why: 
 > David will probably want to know whether the problem exists
 > in stock gcc without FreeBSD's modifications.  Can you test
 > this out and provide feedback in the form of an e-mail
 > message sent to <freebsd-gnats-submit@FreeBSD.org> with
 > the subject line of this message?
 > 
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=21026
 
 This problem appears also in a stock gcc-2.95.2 I've just built
 on FreeBSD without any mods, same sig11 in cc1 when comparisons
 between floats and ints are made.
 
 N.B. the following code cause the problem :
 
 main() {
 	float a;
 	if (a>0);
 }
 
 but this doesn't :
 
 main() {
  	float a;
 	if ((int)a>0);
 }
 
 Granted the second is effectively a little more correct, however it
 still shouldn't segfault but warn about either casting the float to
 int for the comparison or casting the 0 to float for comparison with
 a. I'm still unsure which way round the problem is though, but it does
 appear to be a gcc bug rather than a bug with the FreeBSD
 modifications.
 
 {
 This stock gcc also crashes with -mno-move and -march=pentiumpro
 as well, but that's triggering what seems like buggy gcc code rather
 than some obscure sig11. : 
 /usr/tempgcc/bin/gcc -O6 -march=pentiumpro -mno-move -c main.c -o main.o
 main.c: In function `main':
 main.c:206: Internal compiler error in `instantiate_virtual_regs_1', at function.c:3863
 Please submit a full bug report.
 See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for instructions.
 *** Error code 1
 }
  
 	Steve Roome
 
State-Changed-From-To: feedback->closed 
State-Changed-By: obrien 
State-Changed-When: Fri Nov 10 22:18:27 PST 2000 
State-Changed-Why:  
Since this bug also occurs in stock 2.95.2 GCC, it needs to be reported 
to gcc-bugs@gcc.gnu.org. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=21026 
>Unformatted:
