https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93512
Bug ID: 93512 Summary: Introduce rotate_truncation_mask Product: gcc Version: unknown Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: dje at gcc dot gnu.org CC: jakub at gcc dot gnu.org, segher at gcc dot gnu.org Depends on: 93505 Target Milestone: --- <jakub> i386.md has ;; Avoid useless masking of count operand. <jakub> (define_insn_and_split "*<rotate_insn><mode>3_mask" <jakub> and (define_insn_and_split "*<rotate_insn><mode>3_mask_1" <jakub> for this purpose <segher> yeah... but that catches not all cases at all. but the common ones, sure <jakub> the other option is to say that in RTL all rotate counts are well defined and so effectively have implicit ROTATE_COUNT_TRUNCATED <jakub> or introduce rotate_truncation_mask with a default that will truncate and let weirdo targets opt out <segher> yes, i think that would help all targets <jakub> in any case, that looks like GCC 11 material to me <jakub> because one would need to check all code that works with rotates, do the masking, ensure simplify-rtx.c simplifies it etc. <jakub> would need to be a property of ROTATE/ROTATERT, because e.g. for library implementation if it is done using shifts we don't want to introduce UB there <jakub> so with the combine.c change you've acked perhaps we could defer the rest for GCC11 (and at that point change even that hunk to do % prec Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93505 [Bug 93505] [8/9/10 Regression] wrong code or ICE with __builtin_bswap64() and rotation at -Og