------- Comment #6 from jakub at gcc dot gnu dot org 2009-11-06 08:46 ------- Subject: Bug 41935
Author: jakub Date: Fri Nov 6 08:46:45 2009 New Revision: 153962 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153962 Log: PR middle-end/41935 * c-common.c (fold_offsetof_1) <case ARRAY_REF>: Don't crash for VLAs or non-constant index, allow index one past the last element and allow exceeding array bound in arrays that might be used as flexible array members. * gcc.dg/pr41935.c: New test. * c-c++-common/pr41935.c: New test. * c-c++-common/builtin-offsetof.c (f0): Allow index one past the last element. * gcc.c-torture/execute/pr41935.c: New test. Added: trunk/gcc/testsuite/c-c++-common/pr41935.c trunk/gcc/testsuite/gcc.c-torture/execute/pr41935.c trunk/gcc/testsuite/gcc.dg/pr41935.c Modified: trunk/gcc/ChangeLog trunk/gcc/c-common.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/c-c++-common/builtin-offsetof.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41935