From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18937 invoked by alias); 21 Mar 2014 23:46:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 18902 invoked by uid 48); 21 Mar 2014 23:45:56 -0000 From: "sje at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/60604] GCC incorrectly compiles s_csinh function on MIPS Date: Fri, 21 Mar 2014 23:46:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sje at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-03/txt/msg02014.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60604 --- Comment #1 from Steve Ellcey --- Created attachment 32428 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32428&action=edit New reduced test case Here is a new reduced test case that calls no libm functions. I am pretty sure that the bug is in the handling of __builtin_fabs and specifically in expand_absneg_bit where we use the MIPS exp instruction to genreate a floating point absolute value. I am not sure exactly what the problem is, but if I have this routine always return NULL_RTX and use a differentr method of computing a floating point absolute value then my program works. I thought it might be a simulator issue since I do most of my testing with qemu but I ran the executable on hardware and got failures there. The new reduced test case prints with -O0 or -O1 prints: x = 0.634964 1.298458 In __csinh(1), 0.634964 1.29846 In __csinh(2), 0.634964 1.29846 x = 0.000000 0.000000 With -O2 or -O3 it prints: x = 0.634964 1.298458 In __csinh(1), 0.634964 1.29846 In __csinh(2), 1.00959e+116 1.29846 In if statement x = 0.000000 0.000000