Skip to content
Snippets Groups Projects
  • Jakub Jelinek's avatar
    d32599a6
    re PR c/41935 (ICE : tree check: expected integer_cst, have nop_expr in... · d32599a6
    Jakub Jelinek authored
    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
    d32599a6
    History
    re PR c/41935 (ICE : tree check: expected integer_cst, have nop_expr in...
    Jakub Jelinek authored
    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