This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Can't build libiberty (cplus-dem) for target mn10300-elf
- To: law at cygnus dot com
- Subject: Re: Can't build libiberty (cplus-dem) for target mn10300-elf
- From: Alexandre Oliva <aoliva at cygnus dot com>
- Date: 18 May 2000 19:38:33 -0300
- Cc: gcc-patches at gcc dot gnu dot org
- Organization: Cygnus Solutions, a Red Hat Company
- References: <4310.958678086@upchuck>
On May 18, 2000, Jeffrey A Law <law@cygnus.com> wrote:
> If you look at the dump after if-conversion you'll find that you've got
> something like this:
> (insn 34 31 38 (set (reg/v:SI 59)
> (const_int 0 [0x0])) 6 {tstsi-8} (nil)
> (expr_list:REG_UNUSED (reg/v:SI 59)
> (expr_list:REG_EQUAL (const_int 0 [0x0])
> (nil))))
> In theory, if every register set by an insn is unused and the insn has no
> other side effects (like modifying memory, auto-inc, whatever), then the
> insn should be deleted instead of having REG_UNUSED notes attached to it
> (search for REG_UNUSED in flow.c).
> So, I think the bug is that we didn't delete this insn after it was made
> useless by if-conversion.
Yup. But the problem seems to be hard to fix. Close to the end of
noce_process_if_block(), there's a comment that explains why the insn
wasn't deleted:
/* Several special cases here: First, we may have reused insn_b above,
in which case insn_b is now NULL. Second, we want to delete insn_b
if it came from the ELSE block, because follows the now correct
write that appears in the TEST block. However, if we got insn_b from
the TEST block, it may in fact be loading data needed for the comparison.
We'll let life_analysis remove the insn if it's really dead. */
if (insn_b && else_bb)
We don't have an `else_bb', so insn_b is left for life_analysis() to
delete. However, life_analysis() will only run in flow2, just after
greg, in which the problem shows up.
--
Alexandre Oliva Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org} Write to mailing lists, not to me