From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17728 invoked by alias); 26 Aug 2005 09:35:41 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 17628 invoked by uid 48); 26 Aug 2005 09:35:16 -0000 Date: Fri, 26 Aug 2005 10:28:00 -0000 Message-ID: <20050826093516.17627.qmail@sourceware.org> From: "uros at kss-loka dot si" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050826022604.23570.chen@sys.wakayama-u.ac.jp> References: <20050826022604.23570.chen@sys.wakayama-u.ac.jp> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug target/23570] [4.0/4.1 Regression] internal compiler error: in merge_assigned_reloads, at reload1.c:6091 X-Bugzilla-Reason: CC X-SW-Source: 2005-08/txt/msg03000.txt.bz2 List-Id: ------- Additional Comments From uros at kss-loka dot si 2005-08-26 09:35 ------- (In reply to comment #3) > Unfortunatelly, ludcompf() result (the second one) is wrong when -O1 or -O2 > is used. It is correct without optimizations. This is a problem of infamous i387 precision handling. The error can be found in this part of the code: ... if (u.sf[1] > t) { t = u.sf[1]; n = 1; } if (u.sf[2] > t) { t = u.sf[2]; n = 2; } if (u.sf[3] > t) { t = u.sf[3]; n = 3; } ... Without optimizations, the values of u.sf[1] and t that are at some moment loaded into x87 registers are: u.sf[1] = 1.000000119... t = 0.999999880... and branch is taken. However, with optimizations, the values are different: u.sf[1] = 0.999999642... t = 0.999999821... This is a problem of the i387 design and not the problem of gcc. In your case, you should use -ffloat-store or -mfpmath=sse. BTW: At the moment, I have very limited time, so I won't be able to create a patch to fix the ICE for some time... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23570