Article View: gnu.gcc.bug
Article #6297Incorrect use of SET_DEST() in find_equiv_reg().
From: Michel Delval
Date: Mon, 11 Dec 1995 00:00
Date: Mon, 11 Dec 1995 00:00
71 lines
2565 bytes
2565 bytes
(Sorry, the previous message was incomplete)
----------------------------------------------------------------
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 suggest having a look at every use of `SET_DEST (PATTERN (...))'
and `SET_SRC (PATTERN (...))' in gcc sources; there may still some places
where `single_set()' should be used.
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:
<199512112029.UAA23408@localhost>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113d02,6c85ef02143ee85f 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: <199512112029.UAA23408@localhost> X-Deja-AN: 121609979 distribution: gnu sender: daemon@cis.ohio-state.edu organization: GNUs Not Usenet newsgroups: gnu.gcc.bug