From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11647 invoked by alias); 13 Jan 2014 10:39:46 -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 11626 invoked by uid 48); 13 Jan 2014 10:39:43 -0000 From: "savin.zlobec at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/59784] New: Nios2: Wrong code generation for fextsd custom instruction Date: Mon, 13 Jan 2014 10:39:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: savin.zlobec at gmail dot com 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: 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-01/txt/msg01336.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59784 Bug ID: 59784 Summary: Nios2: Wrong code generation for fextsd custom instruction Product: gcc Version: unknown Status: UNCONFIRMED Severity: major Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: savin.zlobec at gmail dot com Created attachment 31819 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31819&action=edit Fix The following code: double f2d(float x) { return (double)x; } Compiled with -O2 ... -mcustom-frdy=2 ... -mcustom-fextsd=37 Compiles to: 0: 2009c972 custom 37,r4,r4,zero 4: 0009c0b2 custom 2,r4,zero,zero 8: 2005883a mov r2,r4 c: 2807883a mov r3,r5 10: f800283a ret Note the 'custom 37,r4,r4,zero', should be 'custom 37,r5,r4,zero'. Patch attached.