From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27656 invoked by alias); 22 Mar 2014 00:48:45 -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 27455 invoked by uid 48); 22 Mar 2014 00:48:41 -0000 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/60604] GCC incorrectly compiles s_csinh function on MIPS32 (32bit fp) Date: Sat, 22 Mar 2014 00:48: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: pinskia 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: cf_gcctarget short_desc 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/msg02017.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60604 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Target|mips*-*-* |mips*-*-* (o32/eabi32) Summary|GCC incorrectly compiles |GCC incorrectly compiles |s_csinh function on MIPS |s_csinh function on MIPS32 | |(32bit fp) --- Comment #3 from Andrew Pinski --- The code generation looks incorrect to me: mfc1 $3,$f12 mfc1 $2,$f12 move $17,$3 jal myclassify ext $16,$2,0,31 Notice how $2/$3 are moving from the same register, one of them should have been $f13. The problem is due to paired floating point registers are swapped for big-endian. /* Paired FPRs are always ordered little-endian. */ So when the register allocator is figuring out which register to copy from for the high subreg of the DF mode: (insn 23 22 24 (set (subreg:SI (reg:DF 200 [ D.2940 ]) 0) (and:SI (subreg:SI (reg:DF 194 [ D.2940 ]) 0) (const_int 2147483647 [0x7fffffff]))) t77.c:25 -1 (nil)) It decides that is the same as the register which is incorrect for pair float. This is what the register allocator produces: (insn 110 8 23 2 (set (reg:SI 2 $2) (reg:SI 44 $f12)) t77.c:25 302 {*movsi_internal} (nil)) (insn 23 110 111 2 (set (reg:SI 16 $16 [ D.2940 ]) (and:SI (reg:SI 2 $2) (const_int 2147483647 [0x7fffffff]))) t77.c:25 157 {*andsi3} (nil)) This is incorrect as we should be using $f13 or the full DI mode instead.