typedef long long s64; From http://embed.cs.utah.edu/embarrassing/dec_09/harvest/gcc-head_llvm-gcc-head/ typedef unsigned long long u64; union ktime { s64 tv64; }; typedef union ktime ktime_t; ktime_t ns_to_ktime (u64 ns); union ktime const ktime_zero = { 0LL }; ktime_t ns_to_ktime (u64 ns) { ktime_t __constr_expr_0; { __constr_expr_0.tv64 = (s64) ((u64) ktime_zero.tv64 + ns); return (__constr_expr_0); } } /* Checksum = 1A82CF6 */ this generates with 4.5.0 20091219 -O2 movq %rdi, %rax addq ktime_zero(%rip), %rax ret llvm in this case uses the known const value of ktime_zero and just generates an assignment (this makes more difference with -m32) gcc should too.
fold_const_aggregate_ref should handle it but maybe the CONSTRUCTOR does not the field set.
Fixed in 4.6.0.