🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #6291

Incorrect use of SET_DEST() in find_equiv_reg().

#6291
From: Michel Delval
Date: Mon, 11 Dec 1995 00:00
63 lines
2267 bytes
	Hi,

	I've found a bug in find_equiv_reg() in reload.c about the use
of local variable ``where''; it is supposed to be an insn with a `(set
dst src)' inside; there is a place where the following use of
``where'' may not always be valid :

----------------------------------------------------------------
  if (goal_mem && value == SET_DEST (PATTERN (where))
      && refers_to_regno_for_reload_p (valueno,
				       (valueno
					+ HARD_REGNO_NREGS (valueno, mode)),
				       goal, NULL_PTR))
    return 0;
----------------------------------------------------------------


	It doesn't work if `PATTERN (where)' is something like :

		(parallel 
		  [(set dst src)
		   (clobber foo)])


	It seems to be better to write :

----------------------------------------------------------------
  {
    rtx	set = single_set (where);

    if (goal_mem && value == SET_DEST (set)
	&& refers_to_regno_for_reload_p (valueno,
					 (valueno
					  + HARD_REGNO_NREGS (valueno, mode)),
					 goal, NULL_PTR))
      return 0;
  }
----------------------------------------------------------------


	otherwise some invalid replacements are performed
sometimes. It is not fixed in gcc-2.7.2; I hope this help.

-- 


			[mfd]

	+-------------------------------------------------------+
	|  Michel DELVAL					|
	+-------------------------------------------------------+
	|  E-mail:	mfd@ccv.fr				|
	+-------------------------------------------------------+
	|  Computers, Communications				|
	|  and Visions (C2V)       				|
	|  82 boulevard Haussmann				|
	|  75008 Paris FRANCE					|
	|  Phone	(1) 40 08 07 07				|
	|  Fax		(1) 43 87 35 99				|
	+-------------------------------------------------------+
	|	Hackers do it with bugs.			|
	+-------------------------------------------------------+
Technical Details
Message-ID: <199512112021.UAA23406@localhost>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113d02,6c85ef02143ee85f,start
X-Google-Attributes: gid113d02,public
From: mfd@ccv.FR (Michel Delval)
Subject: Incorrect use of SET_DEST() in find_equiv_reg().
Date: 1995/12/11
Message-ID: <199512112021.UAA23406@localhost>
X-Deja-AN: 121609972
distribution: gnu
sender: daemon@cis.ohio-state.edu
organization: GNUs Not Usenet
newsgroups: gnu.gcc.bug