This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/41935] [4.4/4.5 Regression] ICE : tree check: expected integer_cst, have nop_expr in int_cst_value, at tree.c:8301
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Nov 2009 08:46:58 -0000
- Subject: [Bug c/41935] [4.4/4.5 Regression] ICE : tree check: expected integer_cst, have nop_expr in int_cst_value, at tree.c:8301
- References: <bug-41935-15353@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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