From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Jaeger To: law@cygnus.com Cc: Ulf Carlsson , gcc-patches@gcc.gnu.org, "Keith M. Wesolowski" , "Maciej W. Rozycki" Subject: Re: gcse fix Date: Sun, 14 Jan 2001 08:39:00 -0000 Message-id: References: <1263.963433204@upchuck> X-SW-Source: 2001-01/msg01144.html >>>>> Jeffrey A Law writes: Jeff> 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. Jeff> A valid copy can never have different modes for the source and destination Jeff> operands, so I would think the changes to can_copy_p and its related Jeff> 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)) >> { Jeff> Instead I think you just want to say Jeff> && can_copy_p [GET_MODE (dest)] Jeff> && GET_MODE (dest) == GET_MODE (src)) Jeff> Similarly in hash_scan_set. What is with this patch? It is still needed for mips and has not been added yet :-(. I've just run a make bootstrap on i686-linux-gnu. Is it ok to commit this? I'm giving Jeff credits, hope that's ok. Andreas 2001-01-14 Jeffrey A Law * gcse.c (hash_scan_set): Don't copy between modes ============================================================ Index: gcc/gcse.c --- gcc/gcse.c 2001/01/02 00:58:27 1.113 +++ gcc/gcse.c 2001/01/14 10:53:17 @@ -1925,7 +1925,9 @@ /* 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)) + && want_to_gcse_p (src) + /* Copy between modes is prohibited. */ + && GET_MODE (dest) == GET_MODE (src)) { /* An expression is not anticipatable if its operands are modified before this insn. */ -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj