[Bug rtl-optimization/68381] [6 Regression] wrong code and quality regression with __builtin_mul_overflow() @ aarch64

ktkachov at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 17 15:04:00 GMT 2015


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

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |segher at gcc dot gnu.org

--- Comment #3 from ktkachov at gcc dot gnu.org ---
I think the subst hunk from r230326 should be:
      if (code == MULT
          && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND
              || GET_CODE (XEXP (x, 0)) == SIGN_EXTEND)
          && (GET_CODE (XEXP (x, 1)) == ZERO_EXTEND
              || GET_CODE (XEXP (x, 1)) == SIGN_EXTEND)
          && REG_P (XEXP (XEXP (x, 0), 0))
          && REG_P (XEXP (XEXP (x, 1), 0)))
        {
          if (from == to)
            return x;
        }

that is, return x without any simplifications if we're passed a no-op
substitution (or PC) and perform the normal substitutions and simplifications
otherwise. This seems to fix the testcase for me and not regress the testcase
that r230326 was supposed to fix.
I'll be evaluating this approach further


More information about the Gcc-bugs mailing list