[Bug target/89795] [7/8/9 Regression] wrong code with -O2 -fno-dce -fno-forward-propagate -fno-sched-pressure

ebotcazou at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 28 11:08:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89795

--- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
So the combiner first eliminates a ZERO_EXTEND between 2 instructions as
redundant, which is OK in isolation, but IRA (combine_and_move_insns) later
combines again the same 2 instructions without using the
WORD_REGISTER_OPERATIONS semantics of the combiner.

This mini-combine pass in IRA isn't always run:

  /* Don't move insns if live range shrinkage or register
     pressure-sensitive scheduling were done because it will not
     improve allocation but likely worsen insn scheduling.  */
  if (optimize
      && !flag_live_range_shrinkage
      && !(flag_sched_pressure && flag_schedule_insns))
    combine_and_move_insns ();

which explains the need to -fno-sched-pressure on the ARM.


More information about the Gcc-bugs mailing list