https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91816
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Stam Markianos-Wright <stamm...@gcc.gnu.org>: https://gcc.gnu.org/g:44f77a6dea2f312ee1743f3dde465c1b8453ee13 commit r10-6404-g44f77a6dea2f312ee1743f3dde465c1b8453ee13 Author: Stam Markianos-Wright <stam.markianos-wri...@arm.com> Date: Mon Feb 3 10:25:46 2020 +0000 This patch is for PR target/91816 This is a patch for an issue where the compiler was generating a conditional branch in Thumb2, which was too far for b{cond} to handle. This was originally reported at binutils: https://sourceware.org/bugzilla/show_bug.cgi?id=24991 And then raised for GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91816 As can be seen here: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489c/Cihfddaf.html the range of a 32-bit Thumb B{cond} is +/-1MB. This is now checked for in arm.md and an unconditional branch is generated if the jump would be greater than 1MB. gcc/ChangeLog 2020-02-03 Stam Markianos-Wright <stam.markianos-wri...@arm.com> PR target/91816 * config/arm/arm-protos.h: New function arm_gen_far_branch prototype. * config/arm/arm.c (arm_gen_far_branch): New function arm_gen_far_branch. * config/arm/arm.md: Update b<cond> for Thumb2 range checks. gcc/testsuite/ChangeLog 2020-02-03 Stam Markianos-Wright <stam.markianos-wri...@arm.com> PR target/91816 * gcc.target/arm/pr91816.c: New test.