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]

Small force_to_mode fix


Hi,
This test in force_to_mode seems to bypass some optimizations (such as
removing redundand ANDs) when mask is not 0xffffffff.

Thu May 27 12:26:43 MET DST 1999  Jan Hubicka  <hubicka@freesoft.cz>
	* combine.c (force_to_mode): Try to simplify when mask is not full.

*** combine.old	Thu May 27 12:25:27 1999
--- combine.c	Thu May 27 12:25:35 1999
*************** force_to_mode (x, mode, mask, reg, just_
*** 6289,6297 ****
        && (GET_MODE_MASK (GET_MODE (x)) & ~ mask) == 0)
      return gen_lowpart_for_combine (mode, x);
  
!   /* If we aren't changing the mode, X is not a SUBREG, and all zero bits in
!      MASK are already known to be zero in X, we need not do anything.  */
!   if (GET_MODE (x) == mode && code != SUBREG && (~ mask & nonzero) == 0)
      return x;
  
    switch (code)
--- 6289,6297 ----
        && (GET_MODE_MASK (GET_MODE (x)) & ~ mask) == 0)
      return gen_lowpart_for_combine (mode, x);
  
!   /* If we aren't changing the mode, X is not a SUBREG, and mask is full,
!      we need not do anything.  */
!   if (GET_MODE (x) == mode && code != SUBREG && ~ mask == 0)
      return x;
  
    switch (code)


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