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]

Re: gcse fix



  In message <14688.19044.94355.794985@calypso.engr.sgi.com>you write:
   > Note that both include a 7 in the instruction description - this is
  > the line number of the inline asm. Since they're on the same line, and
  > contain the same code and arguments, *** they are the same
  > instruction. *** The compiler is not smart enough to know that the
  > instruction operates on operands of two different modes and thus
  > should be considered different - all it knows is the text inside
  > __asm__() and the line number.
A valid copy can never have different modes for the source and destination
operands, so I would think the changes to can_copy_p and its related 
functions are unwanted/unnecessary.


 > *************** hash_scan_set (pat, insn, set_p)
  > *** 1875,1881 ****
  >         if (! set_p
  >   	  && regno >= FIRST_PSEUDO_REGISTER
  >   	  /* Don't GCSE something if we can't do a reg/reg copy.  */
  > ! 	  && can_copy_p [GET_MODE (dest)]
  >   	  /* Is SET_SRC something we want to gcse?  */
  >   	  && want_to_gcse_p (src))
  >   	{
  > --- 1875,1881 ----
  >         if (! set_p
  >   	  && regno >= FIRST_PSEUDO_REGISTER
  >   	  /* Don't GCSE something if we can't do a reg/reg copy.  */
  > ! 	  && can_copy_p [GET_MODE (dest)][GET_MODE (src)]
  >   	  /* Is SET_SRC something we want to gcse?  */
  >   	  && want_to_gcse_p (src))
  >   	{
Instead I think you just want to say
	&& can_copy_p [GET_MODE (dest)]
	&& GET_MODE (dest) == GET_MODE (src))

Similarly in hash_scan_set.

jeff


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