------- Comment #3 from jakub at gcc dot gnu dot org 2009-11-04 09:35 -------
Shorter testcase:
/* PR middle-end/41935 */
extern void abort (void);
struct A { int a; int b[10]; };
int
foo (struct A *p)
{
return __builtin_offsetof (struct A, b[p->a]);
}
int
main ()
{
struct A a;
a.a = 7;
if (foo (&a) != 7 * sizeof (int) + __builtin_offsetof (struct A, b))
abort ();
a.a = 2;
if (foo (&a) != 2 * sizeof (int) + __builtin_offsetof (struct A, b))
abort ();
return 0;
}
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jakub at gcc dot gnu dot org
|dot org |
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-11-04 09:35:32
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41935