This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/51244] SH Target: Inefficient conditional branch
- From: "oleg dot endo at t-online dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 28 Dec 2011 02:44:05 +0000
- Subject: [Bug target/51244] SH Target: Inefficient conditional branch
- Auto-submitted: auto-generated
- References: <bug-51244-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51244
--- Comment #5 from Oleg Endo <oleg.endo@t-online.de> 2011-12-28 02:44:05 UTC ---
(In reply to comment #2)
> (In reply to comment #1)
> >
> > BTW, OT, (a != b || a != c) ? b : c could be reduced to b, I think.
> >
>
> Yes, very much so.
> It is reduced to "return b" for -m2, -m2e, -m2a, -m3, -m3e
> but not for -m1 and -m4*.
This seems to be due to the following in sh.h:
#define BRANCH_COST(speed_p, predictable_p) \
(TARGET_SH5 ? 1 : ! TARGET_SH2 || TARGET_HARD_SH4 ? 2 : 1)