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 tree-optimization/28778] strict-aliasing bug



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-08-18 21:15 -------
Here is a full testcase:

typedef long GLint;
void aglChoosePixelFormat(const GLint *);

void find(const int *alistp) {
  const int *blist;
  int list[32];
  if (alistp)
    blist = alistp;
  else {
    list[3] = 42;
    blist = list;
  }
  aglChoosePixelFormat((GLint*)blist);
}
void aglChoosePixelFormat(const GLint *a)
{
  int *b = (int*)a;
  if (b[3] != 42)
    __builtin_abort ();
}

int main(void)
{
  find(0);
  return 0;
}


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code


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


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