An ICE from Ruby, on at least ia64 and amd64, with and without optimization: struct sigcontext { unsigned long int sc_gr; }; #define N (((char *) &((struct sigcontext *) 0)->sc_gr) - (char *) 0) struct tag { unsigned long _pad[N]; }; static struct tag *prot_tag; void error_print (void) { struct tag _tag; prot_tag = &_tag; } The interesting thing is that this ICEs in tree_low_cst, which is supposed to extract an integer from an INTEGER_CST tree, but the tree that we give it is not an INTEGER_CST at all: (gdb) p debug_generic_expr (t) (long unsigned int<D4>) &0B->sc_gr<D1465> * 8 $3 = void
I wonder why Ruby does not use the compiler's defintion of offsetof.
Just for clarity, this happens with the _C_ compiler. The C++ front end gives an error, as expected: t.i:10: error: size of array `_pad' is not an integral constant-expression
: Search converges between 2004-09-02-trunk (#532) and 2004-09-04-trunk (#533).
I almos think it was this patch which caused this ICE: 2004-09-01 Richard Henderson <rth@redhat.com> PR middle-end/17258 * calls.c (initialize_argument_information): Tighten pass-through conditions for pass-by-reference. Remove dead TARGET_EXPR code. Use build_fold_addr_expr. (emit_library_call_value_1): Use build_fold_addr_expr. Remove code that assumes ADDR_EXPR allocates stack space. * fold-const.c (build_fold_addr_expr_with_type): Look through WITH_SIZE_EXPR.
No, this is &a.b fallout.
Subject: Bug 17396 CVSROOT: /cvs/gcc Module name: gcc Changes by: rth@gcc.gnu.org 2004-09-11 17:03:01 Modified files: gcc : ChangeLog c-typeck.c Log message: PR c/17396 * c-typeck.c (build_unary_op): Add legacy offsetof hack. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.5389&r2=2.5390 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&r1=1.371&r2=1.372
http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01101.html