This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch,testsuite] Support dg-require-effective-target label_offsets.
- From: Georg-Johann Lay <avr at gjlay dot de>
- To: Senthil Kumar Selvaraj <senthil_kumar dot selvaraj at atmel dot com>
- Cc: Mike Stump <mikestump at comcast dot net>, Bernd Schmidt <bschmidt at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 4 Nov 2016 10:49:02 +0100
- Subject: Re: [patch,testsuite] Support dg-require-effective-target label_offsets.
- Authentication-results: sourceware.org; auth=none
- References: <d9c9572d-b417-0588-36b3-1e4c19cbcaaf@gjlay.de> <7312dc33-1570-05cb-d532-a55f271d9b3c@redhat.com> <711074f3-d9df-78c1-3981-303b18ed43af@gjlay.de> <A538CFF9-3253-4334-AF47-1D1765B20C93@comcast.net> <197a4e63-9118-b600-f4f7-66047952ba30@gjlay.de> <87twbnzuu9.fsf@atmel.com>
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.
Johann
Regards
Senthil