public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix typo in gcse_emit_move_after
@ 2002-11-08 13:45 Roger Sayle
  2002-11-18 16:58 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Roger Sayle @ 2002-11-08 13:45 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jan Hubicka


Whilst investigating PR optimization/8492, an infinite loop in
GCSE's find_avail_set, I came across some mysterious RTL that I
thought may have been the cause of the problem:

(insn 120 108 15 7 0x0 (set (reg/v:SI 60)
        (reg:SI 71)) -1 (nil)
    (expr_list:REG_EQUAL (reg:SI 71)
        (nil)))

It turns out that the superfluous REG_EQUAL is caused by a typo
in gcse_emit_move_after.  Instead of the expression being PRE'd
the code accidentally duplicates the source of the move in the
REG_EQUAL note.  This is corrected by the patch below.  Unfortunately
this change doesn't resolve PR optimization/8492.  Doh!

The following patch has been tested with a complete "make bootstrap"
and "make -k check", all languages except Ada and treelang, on
i686-pc-linux-gnu with no new regressions.

Ok for mainline?


2002-11-08  Roger Sayle  <roger@eyesopen.com>

	* gcse.c (gcse_emit_move_after): Correct typo in REG_EQUAL note.


Index: gcse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcse.c,v
retrieving revision 1.222
diff -c -3 -p -r1.222 gcse.c
*** gcse.c	14 Oct 2002 18:16:07 -0000	1.222
--- gcse.c	8 Nov 2002 06:33:05 -0000
*************** gcse_emit_move_after (src, dest, insn)
*** 5294,5300 ****
    else
      eqv = SET_SRC (set);

!   set_unique_reg_note (new, REG_EQUAL, copy_insn_1 (src));

    return new;
  }
--- 5294,5300 ----
    else
      eqv = SET_SRC (set);

!   set_unique_reg_note (new, REG_EQUAL, copy_insn_1 (eqv));

    return new;
  }

Roger
--
Roger Sayle,                         E-mail: roger@eyesopen.com
OpenEye Scientific Software,         WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix typo in gcse_emit_move_after
  2002-11-08 13:45 [PATCH] Fix typo in gcse_emit_move_after Roger Sayle
@ 2002-11-18 16:58 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2002-11-18 16:58 UTC (permalink / raw)
  To: Roger Sayle; +Cc: gcc-patches, Jan Hubicka

On Fri, Nov 08, 2002 at 02:30:18PM -0700, Roger Sayle wrote:
> 	* gcse.c (gcse_emit_move_after): Correct typo in REG_EQUAL note.

Ok.


r~

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-11-19  0:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-08 13:45 [PATCH] Fix typo in gcse_emit_move_after Roger Sayle
2002-11-18 16:58 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).