From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17862 invoked by alias); 20 Nov 2014 18:39:24 -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 17833 invoked by uid 48); 20 Nov 2014 18:39:20 -0000 From: "dmalcolm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/64003] New: valgrind complains about get_attr_length_nobnd in insn-attrtab.c from i386.md Date: Thu, 20 Nov 2014 18:39: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: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dmalcolm 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 cf_gcchost cf_gcctarget cf_gccbuild 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-11/txt/msg02309.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64003 Bug ID: 64003 Summary: valgrind complains about get_attr_length_nobnd in insn-attrtab.c from i386.md Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: dmalcolm at gcc dot gnu.org Host: x86_64-unknown-linux-gnu Target: x86_64-unknown-linux-gnu Build: x86_64-unknown-linux-gnu Created attachment 34057 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34057&action=edit Reproducer When I run the jit testsuite under valgrind I consistently see reports from here: Conditional jump or move depends on uninitialised value(s) at 0x5721AED: get_attr_length_nobnd(rtx_insn*) (i386.md:6236) by 0x5715F3A: insn_min_length(rtx_insn*) (i386.md:510) by 0x4F4BE0A: shorten_branches(rtx_insn*) (final.c:1208) by 0x4F52A5A: rest_of_handle_shorten_branches() (final.c:4567) by 0x4F52AAE: (anonymous namespace)::pass_shorten_branches::execute(function*) (final.c:4596) by 0x522354D: execute_one_pass(opt_pass*) (passes.c:2306) by 0x52237C4: execute_pass_list_1(opt_pass*) (passes.c:2358) by 0x52237F5: execute_pass_list_1(opt_pass*) (passes.c:2359) by 0x52237F5: execute_pass_list_1(opt_pass*) (passes.c:2359) by 0x5223832: execute_pass_list(function*, opt_pass*) (passes.c:2369) by 0x4E4884F: cgraph_node::expand() (cgraphunit.c:1773) by 0x4E48EE9: expand_all_functions() (cgraphunit.c:1909) I can reproduce this with cc1 with the attached file at -O2 and above: valgrind ./cc1 get-attr-length-i386.c -O2 This is with r217427 on x86_64-unknown-linux-gnu, configuring with: --enable-valgrind-annotations Turning off the writing of #line directives in read-md.c shows that it's at line 18500 of the generated insn-attrtab.c: ==5819== at 0xD952E2: get_attr_length_nobnd(rtx_insn*) (insn-attrtab.c:18500) somewhere within this monster conditional: 18493 int 18494 get_attr_length_nobnd (rtx_insn *insn ATTRIBUTE_UNUSED) 18495 { 18496 switch (recog_memoized (insn)) 18497 { 18498 case 610: /* *jcc_1 */ 18499 extract_insn_cached (insn); >18500 if ((((INSN_ADDRESSES_SET_P () ? INSN_ADDRESSES (INSN_UID (GET_CODE (operands[0]) == LABEL_REF ? XEXP (operands[0], 0) : operands[0])) : 0) - (insn_current_reference_address (insn))) >= (-126)) && (((INSN_ADDRESSES_SET_P () ? INSN_ADDRESSES (INSN_UID (GET_CODE (operands[0]) == LABEL_REF ? XEXP (operands[0], 0) : operands[0])) : 0) - (insn_current_reference_address (insn))) < (128)))