Richard Earnshaw wrote: > >> Hmm, I wonder if we should just unconditionally call split_all_insns() > >> at the start of md_reorg when -O0. This would address your problem, but > >> have the added benefit that the length calculations would be more > >> accurate. We're going to have to split the insns anyway during output, > >> so why not get it over and done with...
OK, here's a patch to implement this solution, which does indeed fix my original problem as well. Tested on arm-linux-gnueabi with no regressions. OK for mainline? Thanks, Ulrich ChangeLog: * config/arm/arm.c (arm_reorg): Ensure all insns are split. Index: gcc/config/arm/arm.c =================================================================== *** gcc/config/arm/arm.c (revision 189459) --- gcc/config/arm/arm.c (working copy) *************** arm_reorg (void) *** 13359,13364 **** --- 13359,13371 ---- if (TARGET_THUMB2) thumb2_reorg (); + /* Ensure all insns that must be split have been split at this point. + Otherwise, the pool placement code below may compute incorrect + insn lengths. Note that when optimizing, all insns have already + been split at this point. */ + if (!optimize) + split_all_insns_noflow (); + minipool_fix_head = minipool_fix_tail = NULL; /* The first insn must always be a note, or the code below won't -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE ulrich.weig...@de.ibm.com