This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/2] Add test cases for noreorder
- From: Mike Stump <mikestump at comcast dot net>
- To: Andi Kleen <andi at firstfloor dot org>
- Cc: gcc-patches at gcc dot gnu dot org, hubicka at ucw dot cz, Andi Kleen <ak at linux dot intel dot com>
- Date: Sun, 14 Sep 2014 11:37:45 -0700
- Subject: Re: [PATCH 2/2] Add test cases for noreorder
- Authentication-results: sourceware.org; auth=none
- References: <1410717072-21031-1-git-send-email-andi at firstfloor dot org> <1410717072-21031-2-git-send-email-andi at firstfloor dot org>
On Sep 14, 2014, at 10:51 AM, Andi Kleen <andi@firstfloor.org> wrote:
> From: Andi Kleen <ak@linux.intel.com>
>
> Add some simple test cases for noreorder behaving like
> -fno-toplevel-reorder and -fno-toplevel-reorder still working.
> Unfortunately there's no easy way to check for output order in DG,
> so we just check for existence.
I thought some of these would span lines…. foo.*bar could check foo on a line before bar?
/* { dg-final { scan-assembler "section.*foo" } } */
int foo (int a)
{
static const int ar[] = { &&l1 - &&l1, &&l2 - &&l1 };
void *p = &&l1 + ar[a];
goto *p;
l1:
return 1;
l2:
return 2;
}
Yup, works just fine. Some might say it isn’t a feature, but we have no plans to fix it.