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: Unify gcse and cse exp{r,}_equiv_p functions


> In short: put
the switch statement inside a "if (GET_CODE (x) == GET_CODE (y)" statement, and before it add

  result = rtlhooks.exp_equiv_p (x, y, validate, equal_values);
  if (result != -1)
    return result;

No, actually: replace the two if's before the switch statement with


  code = GET_CODE (x);
  result = rtlhooks.exp_equiv_p (x, y, validate, equal_values);
  if (result != -1)
    return result;
  if (code != GET_CODE (y))
    return 0;

and also add a test for

  if (GET_MODE (x) != GET_MODE (y))
     return 0;

at the beginning (before the switch) of the GCSE hook and at the end (before returning -1) of the CSE hook.

Paolo



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