This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix latent bug in crossjumping
- From: Josef Zlomek <zlomj9am at artax dot karlin dot mff dot cuni dot cz>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 13 Feb 2003 23:36:47 +0100
- Subject: Re: Fix latent bug in crossjumping
- References: <1044994461.2333.60.camel@steven> <1045000492.3956.105.camel@steven> <20030213130934.GA20849@artax.karlin.mff.cuni.cz> <20030213181745.GE12198@redhat.com> <20030213182758.GA19095@artax.karlin.mff.cuni.cz> <20030213190702.GC12267@redhat.com>
> Make it a c-torture/execute test case, with
>
> /* We're really testing assemble/link. */
> int main () { return 0; }
I realized it needs -fpic too.
Is -fpic supported by all targets?
Josef
Here is the testcase for gcc.dg:
/* Testcase for http://gcc.gnu.org/ml/gcc-patches/2003-02/msg01017.html */
/* { dg-do link { target *-*-* } } */
/* { dg-options "-O -fpic" } */
int *g;
int main (void)
{
switch (*g)
{
case 0:
{
switch (*g)
{
case 0: *g = 1; break;
case 1:
case 2: *g = 1; break;
case 3:
case 4: *g = 1; break;
}
break;
}
case 1:
{
switch (*g)
{
case 0: *g = 1; break;
case 1:
case 2: *g = 1; break;
case 3:
case 4: *g = 1; break;
}
}
}
return 0;
}