This is the mail archive of the gcc-bugs@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]

[Bug bootstrap/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault



------- Comment #8 from belyshev at depni dot sinp dot msu dot ru  2007-10-09 18:43 -------
// Small testcase, compile with "-march=i586 -O0 -fomit-frame-pointer":

__attribute__((noreturn,noinline)) void abrt (const char *fi, const char *fu)
{
  __builtin_abort ();
}

__attribute__((noinline)) int f (int k)
{
  return k;
}

__attribute__((noinline)) int g (int t, int k)
{
  int b;

  switch (t)
    {
    case 0:
      abrt (__FILE__, __FUNCTION__);

    case 1:
      b = f (k);
      break;

    case 2:
      b = f (k);
      break;

    case 3:
      b = f (k);
      break;

    case 4:
      b = f (k);
      break;

    default:
      abrt (__FILE__, __FUNCTION__);
    }

  return b;
}

int main (void)
{
  if (g (3, 1337) != 1337)
      abrt (__FILE__, __FUNCTION__);
  return 0;
}


// Fails only with -fomit-frame-pointer and with -march <= i586.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33676


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