This is the mail archive of the gcc-patches@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: [PATCH][m68k] PR target/36133 Unnecessary TST insns


Andrew Stubbs <ams@codesourcery.com> writes:

> Actually, the carry bit stuff is redundant, as it stands, because the
> overflow handling already does that same thing. This looks wrong to me - 
> at least on Coldfire (note that this is target independent code) the GTU
> and LTU conditions do not involve the overflow bit. However this is
> probably related to this comment in condition.h:
>
> /* ??? Note that for most targets this macro is misnamed as it applies
>    to the carry flag, not the overflow flag.  */
>
> I suspect that changing this will break other targets (and maybe Coldfire
> also), but it still seems to be best to do it right (hopefully this is
> it).

I suspect that the current uses of CC_NO_OVERFLOW by the m68k backend
are wrong anyway.  As you noted it is actually only used for the
unsigned conditions, which on most targets is controlled by the carry
flag, whereas the overflow flag is not used by target independent code.
IMHO the m68k backend should follow targets like avr or h8300: define
a private flag for unusable overflow flag and use CC_NO_OVERFLOW for the
carry flag.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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