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 middle-end/17526] [4.0 Regression] locale_facets.cc:47: internal compiler error


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-26 04:23 -------
And here is a semi reduced/self-contained source which I came up after debuggin this a little bit:
struct cset_converter { int func; int cd; };
void abort(void); int puts(const char*);
int f(int i){return i;}
void g(void){puts("hi");}
struct conversion
{
  int pair;
  int func;
  int fake_cd;
};
static const struct conversion conversion_tab[] = {
  { 2, 2, 2 },
  { 3, 3, 3 }
};
static struct cset_converter
init_iconv_desc (int i)
{
  struct cset_converter ret;
  unsigned i1;
  char *pair;
  if (!i)
    {
      ret.func = 0;
      ret.cd = 0;
      return ret;
    }
  pair = __builtin_alloca(i*3);
  for (i1 = 0; i1 < (sizeof (conversion_tab) / sizeof ((conversion_tab)[0])); i1++)
    if (i == conversion_tab[i1].pair)
      {
	 ret.func = conversion_tab[i1].func;
	 ret.cd = conversion_tab[i1].fake_cd;
	 return ret;
      }
    
  ret.func = 2;
  ret.cd = f(i);
  if (ret.cd == 4)
    {
      g();
      ret.func = 4;
    }
  return ret;
}
struct f
{
  struct cset_converter a;
  struct cset_converter b;
};

void ff(struct f *a)
{
  a->a = init_iconv_desc(0);
  a->b = init_iconv_desc(1);
}

int main(void)
{
  struct f a;
  ff (&a);
  if (a.a.func!=0 || a.a.cd !=0)
    abort();
  if (a.b.func!=2 || a.b.cd !=1)
    abort();
  return 0;
}


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|regression                  |middle-end


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


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