Skip to content
Snippets Groups Projects
Commit d32599a6 authored by Jakub Jelinek's avatar Jakub Jelinek Committed by Jakub Jelinek
Browse files

re PR c/41935 (ICE : tree check: expected integer_cst, have nop_expr in...

re PR c/41935 (ICE : tree check: expected integer_cst, have nop_expr in int_cst_value, at tree.c:8301)

	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.

From-SVN: r153962
parent 21a15d9f
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment