From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15153 invoked by alias); 24 Jul 2013 11:55: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 15078 invoked by uid 48); 24 Jul 2013 11:55:42 -0000 From: "amylaar at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/57968] New: MODE_EXIT switches inserted too late Date: Wed, 24 Jul 2013 11:55:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: amylaar 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter 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: 2013-07/txt/msg01116.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57968 Bug ID: 57968 Summary: MODE_EXIT switches inserted too late Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: amylaar at gcc dot gnu.org I see a miscompilation of ___muldi3 for epiphany-elf; the witch to MODE_EXIT is done at the start of the exit block, even though it contains instructions that require a different mode. The return register on the epiphany is not likely spilled, and a large register file gives lots of freedom to do optimizations; when optimizig ___muldi3, at end end the return value is not so much copied as calculated piecemeal. There is some existing code in compute_pre_exit that is supposed to preserve computations that need a non-exit mode, but the way it is placed means it is only active when the immediate result is part of the return register.