https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89037
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target|aarch64 |aarch64 x86_64-*-* Status|UNCONFIRMED |NEW Last reconfirmed| |2019-01-24 Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- And on x86_64-linux as well. I guess we should use extract_uhwi instead of TREE_INT_CST_ELT. Oddly enough I need to resort to a widest_int here... (and more than this single place uses TREE_INT_CST_ELT). Index: varasm.c =================================================================== --- varasm.c (revision 268010) +++ varasm.c (working copy) @@ -5407,7 +5407,8 @@ output_constructor_bitfield (oc_local_st = HOST_BITS_PER_WIDE_INT - (shift & (HOST_BITS_PER_WIDE_INT - 1)); /* Now get the bits from the appropriate constant word. */ - value = TREE_INT_CST_ELT (local->val, shift / HOST_BITS_PER_WIDE_INT); + value = wi::extract_uhwi (wi::to_widest (local->val), + shift, HOST_BITS_PER_WIDE_INT); shift = shift & (HOST_BITS_PER_WIDE_INT - 1); /* Get the result. This works only when: