http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50762
--- Comment #17 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-11-10 15:06:40 UTC --- > However, it is rejected by the lea_address_operand predicate check > due to its mode (VOIDmode != SImode). This is a bit odd because most > standard predicates accept a CONST_INT no matter what mode is requested. This isn't only odd, this goes against the documentation: "Predicates written with `define_predicate' automatically include a test that MODE is `VOIDmode', or OP has the same mode as MODE, or OP is a `CONST_INT' or `CONST_DOUBLE'. They do _not_ check specifically for integer `CONST_DOUBLE', nor do they test that the value of either kind of constant fits in the requested mode." > Maybe one way to fix this would be to define lea_address_operand > using define_special_predicate and then implement an appropriate > mode check that handles CONST_INT by hand ... Clearly the oddity you pointed out above is counter-intuitive. It is present in the original patch: http://gcc.gnu.org/ml/gcc-patches/2004-08/msg00663.html Maybe worth discussing on the main list in order to decide what needs to be changed, the documentation or the implementation.