------- Comment #9 from rearnsha at gcc dot gnu dot org 2010-04-01 15:02 ------- This is a miscompilation during stage2. The file libcpp/expr.c is miscompiled.
The problem is occurring in num_positive, which ends up generating a shift of a long long right by 63. The code generated is creating spills that are of SImode variables for the shift output, but then the result is being loaded back as a DImode object. Due to scheduling, one of the stores is being moved incorrectly after the load and we get the following assembly fragment: 342c: fa2b fb02 lsr.w fp, fp, r2 3430: fa0c f003 lsl.w r0, ip, r3 3434: fa2c f301 lsr.w r3, ip, r1 3438: fa2c f202 lsr.w r2, ip, r2 343c: ea40 000b orr.w r0, r0, fp 3440: 9245 str r2, [sp, #276] ; 0x114 <- first part of store 3442: 4686 mov lr, r0 3444: 2201 movs r2, #1 3446: ea1e 0e21 ands.w lr, lr, r1, asr #32 344a: bf38 it cc 344c: 469e movcc lr, r3 344e: a944 add r1, sp, #272 ; 0x110 3450: e9d1 0100 ldrd r0, r1, [r1] <- Load back 3454: 2300 movs r3, #0 3456: f8cd e110 str.w lr, [sp, #272] ; 0x110 <- Second part (oops, too late). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42509