http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59343

--- Comment #7 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to chrbr from comment #5)
> This has been fixed by Oleg in the 4.9 with a new cflow pass. In 4.8 I think
> it's best to just disable it as unsafe, The following workaround is enough
> to to fix the problem:
> 
> Index: sh.md
> ===================================================================
> --- sh.md       (revision 205585)
> +++ sh.md       (working copy)
> @@ -8380,7 +8380,7 @@ label:
>  {
>    return output_branch (sh_eval_treg_value (operands[1]), insn, operands);
>  }
> -  "&& 1"
> +  "&& 0"
>    [(set (pc) (if_then_else (eq (reg:SI T_REG) (match_dup 2))
>                            (label_ref (match_dup 0))
>                            (pc)))]
> 
> do you agree Oleg ?

This has been mentioned in PR 51244 already, I think.

It should not be necessary to disable the T bit optimization completely, only
the cases where there are multiple non-fallthrough basic blocks (i.e. where
there's a label in between).
Something like the patch in
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51244#c64 should do.

Reply via email to