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: Condition branch on least significant bit


Hi Richard,

From: Richard Henderson <rth@redhat.com>
> Any idea how to deal with this problem?

Michael's BImode suggestion is most correct for the common case:
emit BImode compare and then branch.

I followed your and Michael's suggestion (thank you) and that seems to work.... almost. The problem is that I have a benchmark where gcc keeps on looping in reload1.c:


enum machine_mode narrow_mode;
for (narrow_mode = GET_CLASS_NARROWEST_MODE (MODE_INT);
narrow_mode != GET_MODE (reg);
narrow_mode = GET_MODE_WIDER_MODE (narrow_mode))
{
if (have_insn_for (STRICT_LOW_PART, narrow_mode)
...
}


This code loops over all integer modes starting with the smallest one which happens to be QImode. In the case that gcc loops forever, reg is BImode and therefore the loop never terminates. What is wrong?

- Is it that have_insn_for (STRICT_LOW_PART, narrow_mode) is always false? If so, how to fix this?
- Is it that the termination condition of the loop is not correct. I see many of these loops in gcc where mode != VOIDmode is the termination condition?
- Should GET_CLASS_NARROWEST_MODE (MODE_INT) return BImode instead of SImode which it currently seems to do?


Cheers,
Jan

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail



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