From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13330 invoked by alias); 24 Jan 2015 01:07:52 -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 12978 invoked by uid 48); 24 Jan 2015 01:07:35 -0000 From: "kkojima at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/64761] New: [4.9/5 Regression] -freorder-blocks-and-partition causes some failures on SH Date: Sat, 24 Jan 2015 01:07: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: 5.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: kkojima 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 keywords bug_severity priority component assigned_to reporter cf_gcctarget 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: 2015-01/txt/msg02655.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64761 Bug ID: 64761 Summary: [4.9/5 Regression] -freorder-blocks-and-partition causes some failures on SH Product: gcc Version: 5.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: kkojima at gcc dot gnu.org Target: sh*-*-* For SH, we have two failures on testsuite FAIL: gcc.dg/tree-prof/cold_partition_label.c compilation, -fprofile-use -D_PROFILE_USE (internal compiler error) FAIL: gcc.dg/tree-prof/va-arg-pack-1.c compilation, -fprofile-use -D_PROFILE_USE (internal compiler error) with -freorder-blocks-and-partition. Although both test cases are added at 4.9, they don't fail with 4.8.4 compiler. So this is a 4.9/5 regression from 4.8. In both cases, (set (pc) (label_ref ...)) can't be recognized because CROSSING_JUMP_P (insn) is set. I've added a new insn (define_insn "*jump_compact_crossing" [(set (pc) (label_ref (match_operand 0 "" "")))] "TARGET_SH1 && flag_reorder_blocks_and_partition && CROSSING_JUMP_P (insn)" { /* The length is 16 if the delay slot is unfilled. */ return output_far_jump (insn, operands[0]); } [(set_attr "type" "jump") (set_attr "length" "16")]) to sh.md. I guess that it's enough ATM, though it isn't optimal. Then we get another failures for both tests like: Error: displacement to defined symbol .L10 overflows 8-bit field from assembler. It looks almost wrong branches came from follow jump optimization. Giving SH specific TARGET_CAN_FOLLOW_JUMP target macro as static bool sh_can_follow_jump (const rtx_insn *, const rtx_insn *) { if (TARGET_SH1 && flag_reorder_blocks_and_partition && simplejump_p (branch2) && CROSSING_JUMP_P (branch2)) return false; return true; } could fix them. Joern had already proposed https://gcc.gnu.org/ml/gcc-patches/2013-04/msg01332.html which replaces MD_REDIRECT_BRANCH with TARGET_CAN_FOLLOW_JUMP and these changes could be merged. I'll attach the patches for it.