The problem appears in revision 200588 in version 4.9. In method "validate_const_int()" in gcc/read-rtl.c, the loop on line 804 should break immediately after "valid" is set to "0". All the iterations after "valid" set to "0" do not perform any useful work, at best they just set "valid" again to "0".
Created attachment 30440 [details] Suggested patch
Patch sent to gcc-patches@: http://gcc.gnu.org/ml/gcc-patches/2013-07/msg00662.html
Fixed on trunk.