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] Fix PR37053: Move tweaks of commutative precedence to target hook



Notice how we're doing a final bit of validation -- constrain_operands --
here rather than in the validate routines.  We're assuming that if this
extra validation fails, we can simply call validate_replace_rtx again
to revert the change.  But this isn't always true, because the
validation routines can "canonicalise" the resulting insn.
It would be more robust (and cleaner) to treat this replacement
in the same way as post-reload ones, and do the constrain_operands
in recog.c:insn_invalid_p.

Note that it is already being done if reload_completed, just not if reload_in_progress. No matter how pleasant, it would be a surprise if the attached patch worked without this change it includes:


-      if (! constrain_operands (1))
+      if (! constrain_operands (reload_completed))

(Note: I haven't tested it with the change, either). On the other hand, with the change there is a subtle difference in reload_as_needed now (I'm not sure it matters).

Maxim, can you try it on m68k?

Paolo

Attachment: pr37053.patch
Description: Text document


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