From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23442 invoked by alias); 12 Aug 2010 12:35:21 -0000 Received: (qmail 23431 invoked by uid 22791); 12 Aug 2010 12:35:20 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Aug 2010 12:34:44 +0000 Received: (qmail 17286 invoked from network); 12 Aug 2010 12:34:42 -0000 Received: from unknown (HELO caradoc.them.org) (dan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 12 Aug 2010 12:34:42 -0000 Date: Thu, 12 Aug 2010 12:35:00 -0000 From: Daniel Jacobowitz To: Yao Qi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH,Testsuite] Add .align 2 for labels on Thumb Message-ID: <20100812123437.GA31629@caradoc.them.org> Mail-Followup-To: Yao Qi , gdb-patches@sourceware.org References: <20100812081814.GA24769@qiyaows> <201008120935.o7C9Zpid015638@glazunov.sibelius.xs4all.nl> <20100812114907.GB24769@qiyaows> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100812114907.GB24769@qiyaows> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-08/txt/msg00173.txt.bz2 On Thu, Aug 12, 2010 at 07:49:08PM +0800, Yao Qi wrote: > In original test case, breakpoint is set on insn nop, while main > branches to insn push, so breakpoint is not hit. > > 0000000a : > a: bf00 nop > > 0000000c : > c: b480 push {r7} > > I thought this nop is generated for alignment, so I added '.align 2' > for label func_loopfb_start to force it to be equal to func_loopfb. I > make a mistake here. > > I don't know why nop is generated on label func_loopfb_start, and once > '.align 2' is added, nop is *not* generated, so failures go away by > accident. Can you use func_loopfb instead of func_loopfb_start in the .S file? Or, can you define func_loopfb_start as asm ("func_loopfb_start = func_loopfb")? A third option is to address Mark's concern by using ".p2align 4"; I believe that is 16-byte alignment on all platforms gas supports, and this test probably requires gas in practice already. The existing code is not correct, for the reason you've found; the compiler typically uses .align or .p2align at the start of a function. -- Daniel Jacobowitz CodeSourcery