This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: gcse fix
- To: Ulf Carlsson <ulfc at calypso dot engr dot sgi dot com>
- Subject: Re: gcse fix
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Wed, 12 Jul 2000 14:20:04 -0600
- cc: gcc-patches at gcc dot gnu dot org, Andreas Jaeger <aj at suse dot de>
- Reply-To: law at cygnus dot com
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