https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100264
Bug ID: 100264 Summary: REE does not work on PARALLEL expressions with a single register SET child Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: christophm30 at gmail dot com Target Milestone: --- REE iterates over all SET expressions and tries to eliminate redundant zero-extensions. In case of a PARALLEL expression, there is a check in place to ensure that "only one child of a PARALLEL expression is a SET". Let's imagine a PARALLEL expression with two register SETs. An example would be store-conditional, which sets a memory location (store target) as well as a register (return success value). The current implementation is not able to optimize a zero-extension of the return value of store-conditional. This can be solved, by moving the check for register targets (i.e. REG_P ()) into the function get_sub_rtx () and change the restriction of REE to "only one child of a PARALLEL expression is a SET register".