This is the mail archive of the gcc-bugs@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]

[Bug middle-end/27743] [4.1/4.2 Regression] Wrong code for ((unsigned) ((a) >> 2)) >> 15



------- Comment #2 from rguenth at gcc dot gnu dot org  2006-05-23 14:27 -------
      /* Turn (a OP c1) OP c2 into a OP (c1+c2).  */
      if (TREE_CODE (arg0) == code && host_integerp (arg1, false)
          && TREE_INT_CST_LOW (arg1) < TYPE_PRECISION (type)
          && host_integerp (TREE_OPERAND (arg0, 1), false)
          && TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1)) < TYPE_PRECISION (type))
        {

this should read TREE_CODE (op0) == code.  Or

  if (kind == tcc_comparison)
    {
      STRIP_SIGN_NOPS (arg0);
      STRIP_SIGN_NOPS (arg1);
    }
  else
    {
      STRIP_NOPS (arg0);
      STRIP_NOPS (arg1);
    }

should use STRIP_SIGN_NOPS for arg0 and shifts.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27743


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