From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7471 invoked by alias); 4 Nov 2012 17:32:19 -0000 Received: (qmail 7340 invoked by uid 48); 4 Nov 2012 17:31:55 -0000 From: "amylaar at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/55195] [4.8 Regression] shorten_branches generates incorrect forward branch distances Date: Sun, 04 Nov 2012 17:32: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-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-Changed-Fields: CC Component Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-11/txt/msg00291.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55195 Jorn Wolfgang Rennecke changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |law at redhat dot com Component|middle-end |target --- Comment #4 from Jorn Wolfgang Rennecke 2012-11-04 17:31:52 UTC --- (In reply to comment #3) In the ccA1Vjgkjx.234r.shorten dump file, between L19464 and L19463, there is but one call instruction, a basic block start, a barrier, and some 600 NOTE_INSN_VAR_LOCATION: (code_label 4141 28778 2472 19464 "" [1 uses]) (note 2472 4141 3318 [bb 311] NOTE_INSN_BASIC_BLOCK) (call_insn:TI 3318 2472 3319 (parallel [ (call (mem:SI (symbol_ref/v:SI ("@_Jv_ThrowBadArrayIndex") [flags 0x241] ) [0 S4 A32]) (const_int 16 [0x10])) (clobber (reg:SI 1 %r1)) (clobber (reg:SI 2 %r2)) (use (reg:SI 19 %r19)) (use (const_int 0 [0])) ]) /ssd/synopsys/arc_gnu_4.8-r192641/gcc-4.8/libjava/classpath/gnu/java/nio/charset/MacSymbol.java:73 198 {*call_symref_pic_post_reload} (expr_list:REG_DEAD (reg:SI 26 %r26) (expr_list:REG_DEAD (reg:SI 19 %r19) (expr_list:REG_NORETURN (const_int 0 [0]) (nil)))) (expr_list:REG_CC_SETTER (use (reg:SI 26 %r26)) (nil))) (barrier 3319 3318 28981) (note 28981 3319 28980 (nil) NOTE_INSN_CALL_ARG_LOCATION) ... (note 29183 29182 4140 (var_location D.16611 (nil)) NOTE_INSN_VAR_LOCATION) (code_label 4140 29183 2459 19463 "" [1 uses]) The instruction call_symref_pic_post_reload has the following length attribute setting: (set (attr "length") (symbol_ref "pa_attr_length_call (insn, 0)")) Such a length attribute is not considered variable by shorten_branches. You need to include a clause that is directly in the attribute, e.g. (and (match_test "0") (eq (match_dup 0) (pc)))