https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122438

Andreas Schwab <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|target                      |rtl-optimization
                 CC|                            |law at gcc dot gnu.org
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=115877

--- Comment #6 from Andreas Schwab <[email protected]> ---
Reduced testcase:

long describeCell_nLocal;
char describeCell_a;
char describeCell_zDesc[];
int strlen(char *);
void describeContent(char *, char *);
void localPayload();
void describeCell(char cType) {
  long long nDesc;
  if (cType)
    nDesc += nDesc;
  localPayload();
  if (describeCell_nLocal)
    nDesc += strlen(&describeCell_zDesc[nDesc]);
  if (cType)
    describeContent(&describeCell_a, &describeCell_zDesc[nDesc]);
}

The problem is that (clobber (reg:SI 0 %d0)) uses the same reg as one of the
inputs despite the earlyclobber in the adddi3 pattern.

LRA chooses the d,0,d,X alternative which does not need the scratch.

Reply via email to