From leafy@leafy.idv.tw  Thu Nov 21 16:59:31 2002
Return-Path: <leafy@leafy.idv.tw>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 25F0537B401
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 21 Nov 2002 16:59:31 -0800 (PST)
Received: from seed.net.tw (sn13.seed.net.tw [139.175.54.13])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5941E43E9C
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 21 Nov 2002 16:59:25 -0800 (PST)
	(envelope-from leafy@leafy.idv.tw)
Received: from [61.59.152.177] (port=49476 helo=leafy.idv.tw)
	by seed.net.tw with esmtp (Seednet 4.10:2)
	id 18F2AG-000CFC-00
	for FreeBSD-gnats-submit@freebsd.org; Fri, 22 Nov 2002 08:59:24 +0800
Received: from leafy.idv.tw (localhost [127.0.0.1])
	by leafy.idv.tw (8.12.6/8.12.6) with ESMTP id gAM0xNDs094715
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 22 Nov 2002 08:59:23 +0800 (CST)
	(envelope-from leafy@leafy.idv.tw)
Received: (from root@localhost)
	by leafy.idv.tw (8.12.6/8.12.6/Submit) id gAM0xNgx094714;
	Fri, 22 Nov 2002 08:59:23 +0800 (CST)
	(envelope-from leafy)
Message-Id: <200211220059.gAM0xNgx094714@leafy.idv.tw>
Date: Fri, 22 Nov 2002 08:59:23 +0800 (CST)
From: JY <leafy@leafy.idv.tw>
Reply-To: JY <leafy@leafy.idv.tw>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: port lcms fails test after build on current
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         45576
>Category:       ports
>Synopsis:       port lcms fails test after build on current
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 21 17:00:01 PST 2002
>Closed-Date:    Thu May 22 09:16:53 PDT 2003
>Last-Modified:  Thu May 22 09:16:53 PDT 2003
>Originator:     JY
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD leafy.idv.tw 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Wed Nov 20 18:45:21 CST 2002 root@leafy.idv.tw:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:
	After building lcms, it fails the join curve test
cc -O -pipe -march=pentium4 -I../include -c testcms.c
cc -O -pipe -march=pentium4 -I../include testcms.o ../src/liblcms.a -o testcms -
lm
./testcms
little cms testbed. Ver 1.09 [build Nov 22 2002 08:57:29]

Testing fixed point: 2.8848960205 = 2.8848
                0.437499269828536 = 0.4374
Testing fixed scaling...pass.
Testing curves join ...failed!
*** Error code 1

Stop in /usr/ports/graphics/lcms/work/lcms-1.09/testbed.
*** Error code 1

>How-To-Repeat:
	make clean install
>Fix:

	


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: edwin 
State-Changed-When: Tue Apr 1 18:53:18 PST 2003 
State-Changed-Why:  
Seems to be fixed now: 
Testing fixed scaling...pass. 
Testing curves join ...pass. 

Thanks for your report! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=45576 
State-Changed-From-To: closed->open 
State-Changed-By: edwin 
State-Changed-When: Tue Apr 1 19:44:55 PST 2003 
State-Changed-Why:  
Reopened on submitters request: 

1) build world and install world with CPU=p4 <-this should be ok for lcms 
2) do 1) again (meaning the gcc is now built with p4-optimization by a p4-optimized gcc) 

As Terry Lambert puts it "It's a CPU implementation bug" and it 
seems to be a gcc vs P4 problem that might not be fixe din a short 
timeframe. 

I'm taking my hands of it - edwin 


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

From: Dofri Jonsson <imp@hell.is>
To: freebsd-gnats-submit@FreeBSD.org, leafy@leafy.idv.tw
Cc:  
Subject: Re: ports/45576: port lcms fails test after build on current
Date: Fri, 11 Apr 2003 08:33:37 +0000

 Actually, this is a bug in gcc that miscompiles some floating point 
 calculations with -march=pentium4.
 Specifically, libm (msun) is miscompiled, causing the tests in lcms to fail.
 Recompile world with -march=pentium3 or less, or CFLAGS=-mno-sse2 for a 
 workaround.
 
 I have verified this in both gcc 3.2.1 and gcc 3.2.2.
 
 See PR bin/43299: march=pentium4 miscompiles msun/src/e_pow.c for more 
 details.
 
State-Changed-From-To: open->closed 
State-Changed-By: mi 
State-Changed-When: Thu May 22 09:12:01 PDT 2003 
State-Changed-Why:  
This is the problem with the gcc compiler. The libm in /usr/src/lib/msun 
can not, at the moment be compiled with march=pentium4. As noted in the 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=43299 

and in 

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10774 

the problem is fixed in the most recent gcc release 3.3. Note, that the 
lcms itself need not be recompiled, but rebuilding libm with either 
march=pentium3 or with the gcc33 will solves the problem. We will have 
to live with this workaround, until FreeBSD incorporates the gcc-3.3. 

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