This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Missing barrier in outof_cfglayout


On 05/11/2015 10:19 AM, Georg-Johann Lay wrote:
When pass outof_cfglayout is adding barriers, it appears that it misses
some situations and then runs into "ICE: missing barrier" in the
remainder (or, with checking disabled, into some other assertion).


[ ... ]



The last else is entered for an UNconditional jump with e_fall = 0 so
that after the unconditional jump_insn no barrier is emit.

Now I am unsure about the right condition when to add the missing
barrier; the following change works, but presumably the condition is
only 99% correct ;-)
But why is there a JUMP_INSN here to start with? Prior to cfglayout I believe simple unconditional jumps shouldn't exist in the INSN chain. Instead they are inserted as we leave cfglayout based on the state of the CFG.


The respective BB has just that unconditional jump_insn; it is generated
by CSE1 as it optimized a switch statement and was originally some
conditional jump (-fno-jump-tables) or computed jump (with -fjump-tables):
This is where I'd focus my efforts. Instead of modifying the JUMP_INSN directly, we're supposed to be going through the various CFG routines.

Most likely it's this code:
     /* If this SET is now setting PC to a label, we know it used to
         be a conditional or computed branch.  */
      else if (dest == pc_rtx && GET_CODE (src) == LABEL_REF
               && !LABEL_REF_NONLOCAL_P (src))
...

new_rtx = emit_jump_insn_before (gen_jump (XEXP (src, 0)), insn);
              JUMP_LABEL (new_rtx) = XEXP (src, 0);
              LABEL_NUSES (XEXP (src, 0))++;


And it almost certainly should be calling into the cfgrtl.c routines instead.

jeff



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]