https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81863
--- Comment #6 from ard.biesheuvel at linaro dot org ---
FWIW, the following makes the issue go away (tested on 4.9.4)
@@ -6196,7 +6210,9 @@
[(set (match_operand:SI 0 "nonimmediate_operand" "=r")
(lo_sum:SI (match_operand:SI 1 "nonimmediate_operand" "0")
(match_operand:SI 2 "general_operand" "i")))]
- "arm_arch_thumb2 && arm_valid_symbolic_address_p (operands[2])"
+ "arm_arch_thumb2 && arm_valid_symbolic_address_p (operands[2])
+ && ( GET_CODE (operands[2]) != SYMBOL_REF
+ || !target_word_relocations)"
"movt%?\t%0, #:upper16:%c2"
[(set_attr "predicable" "yes")
(set_attr "predicable_short_it" "no")
I have no idea whether this is a suitable fix: I will leave that to the
experts. Just providing this as a data point.