From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19899 invoked by alias); 5 Dec 2014 14:19:10 -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 19785 invoked by uid 48); 5 Dec 2014 14:19:04 -0000 From: "rsandifo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/64003] valgrind complains about get_attr_length_nobnd in insn-attrtab.c from i386.md Date: Fri, 05 Dec 2014 14:19: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-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rsandifo at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: enkovich.gnu at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: 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-12/txt/msg00556.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64003 rsandifo at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rsandifo at gcc dot gnu.org --- Comment #25 from rsandifo at gcc dot gnu.org --- (In reply to Ilya Enkovich from comment #21) > (In reply to Jeffrey A. Law from comment #20) > > Ilya, it's the function call in this code I think: > > > > (cond [(eq_attr "length_nobnd" "!0") > > (plus (symbol_ref ("ix86_bnd_prefixed_insn_p (insn)")) > > (attr "length_nobnd")) > > > > You're calling out to ix86_bnd_prefixed_insn_p, and that's problematical for > > branch shortening if I'm understanding Joern's comments here and David's > > comments in the PA port correctly. > > Then we have three problematic patterns and the easiest way to handle it is > to get rid of ix86_bnd_prefixed_insn_p call in length computation for them. > I think the easiest way to do it is to have separate bnd and nobnd patterns > for these instructions. Attached patch helps me to resolve valgrind error. > Is such approach fine? If all you want to do is add 1 byte to the length to account for a prefix then it might be cleaner to use ADJUST_INSN_LENGTH. You could then keep the single nobnd patterns.