From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 71462 invoked by alias); 17 Nov 2016 13:49:50 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 71397 invoked by uid 89); 17 Nov 2016 13:49:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=State X-HELO: eusmtp01.atmel.com Received: from eusmtp01.atmel.com (HELO eusmtp01.atmel.com) (212.144.249.242) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 17 Nov 2016 13:49:39 +0000 Received: from HNOCHT02.corp.atmel.com (10.145.133.41) by eusmtp01.atmel.com (10.145.145.30) with Microsoft SMTP Server (TLS) id 14.3.235.1; Thu, 17 Nov 2016 14:49:29 +0100 Received: from jaguar.atmel.com (10.145.133.18) by HNOCHT02.corp.atmel.com (10.145.133.41) with Microsoft SMTP Server (TLS) id 14.3.235.1; Thu, 17 Nov 2016 14:49:33 +0100 References: <7312dc33-1570-05cb-d532-a55f271d9b3c@redhat.com> <711074f3-d9df-78c1-3981-303b18ed43af@gjlay.de> <197a4e63-9118-b600-f4f7-66047952ba30@gjlay.de> <87twbnzuu9.fsf@atmel.com> <2b4af20b-fbb8-98c7-8f74-c917a56e56d7@gjlay.de> User-agent: mu4e 0.9.17; emacs 24.5.1 From: Senthil Kumar Selvaraj To: Georg-Johann Lay CC: Mike Stump , Bernd Schmidt , gcc-patches Subject: Re: [patch,testsuite] Support dg-require-effective-target label_offsets. In-Reply-To: <2b4af20b-fbb8-98c7-8f74-c917a56e56d7@gjlay.de> Date: Thu, 17 Nov 2016 13:49:00 -0000 Message-ID: <87lgwi1alq.fsf@atmel.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg01804.txt.bz2 Georg-Johann Lay writes: > On 04.11.2016 06:18, Senthil Kumar Selvaraj wrote: >> >> Georg-Johann Lay writes: >>> State of matters is that Binutils support is missing, and if I understand you >>> correctly, dg-require is not appropriate to factor out availability of such >>> features? >> >> I'll take a stab at adding the missing binutils support for avr label diffs. > > Thanks for taking care of this. I had a look into it but got stuck with a test > case derived from gcc.c-torture/execute/pr70460.c > > int c; > > __attribute__((noinline, noclone)) void > call (void) > { > __asm ("nop"); > } > > __attribute__((noinline, noclone)) void > foo (int x) > { > static int b[] = { &&lab1 - &&lab0, &&lab2 - &&lab0 }; > void *a = &&lab0 + b[x]; > goto *a; > lab1: > c += 2; > call(); > lab2: > c++; > lab0: > ; > } > > int > main () > { > foo (0); > if (c != 3) > __builtin_abort (); > foo (1); > if (c != 4) > __builtin_abort (); > return 0; > } > > > The problem is when relaxation is turned on and the CALL is shortened to RCALL > but respective literals are not fixed up. That linker issue is fixed with https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=4cb771f214ed6a2102e37bce255c6be5d0642f3a Regards Senthil