This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix latent bug in crossjumping


> 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;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]