public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* trouble in attempt_auto_inc
@ 2004-01-15 19:36 Richard Zidlicky
  2004-01-16 16:48 ` Joern Rennecke
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Zidlicky @ 2004-01-15 19:36 UTC (permalink / raw)
  To: gcc

Hello,

tracing the m68k trouble with cp-demangle.c:

Breakpoint 5, attempt_auto_inc (pbi=0x849ece8, inc=0x40be2618, 
    insn=0x40ab1fa0, mem=0x40ab4414, incr=0x40ab60c8, incr_reg=0x40b2fc70)
    at ../../gcc-3.4-20040107/gcc/flow.c:3366
3366      if (REGNO (SET_DEST (set)) == REGNO (incr_reg))
(gdb) call debug_rtx(set)
(set (mem:SI (reg/v/f:SI 32 [ mangled ]) [5 S4 A16])
    (reg:SI 915))

At this point REGNO(SET_DEST...) would segfault.

(gdb) call debug_rtx(incr_reg)
(reg:SI 915)

(gdb) call debug_rtx(incr)
(insn 1120 1118 1121 88 cplus-dem.c:3602 (set (mem:SI (reg/v/f:SI 32 [ mangled ]) [5 S4 A16])
        (reg:SI 915)) 25 {*m68k.md:756} (nil)
    (expr_list:REG_DEAD (reg:SI 915)
        (nil)))

(gdb) up
(gdb) print regno
$5 = 915
(dbg) call debug_rtx(set)
(set (mem:SI (reg/v/f:SI 32 [ mangled ]) [5 S4 A16])
    (plus:SI (reg:SI 915)
        (const_int 1 [0x1])))


So what exactly went wrong here?

Richard

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

* Re: trouble in attempt_auto_inc
  2004-01-15 19:36 trouble in attempt_auto_inc Richard Zidlicky
@ 2004-01-16 16:48 ` Joern Rennecke
  0 siblings, 0 replies; 2+ messages in thread
From: Joern Rennecke @ 2004-01-16 16:48 UTC (permalink / raw)
  To: Richard Zidlicky; +Cc: gcc

> Breakpoint 5, attempt_auto_inc (pbi=0x849ece8, inc=0x40be2618, 
>     insn=0x40ab1fa0, mem=0x40ab4414, incr=0x40ab60c8, incr_reg=0x40b2fc70)
>     at ../../gcc-3.4-20040107/gcc/flow.c:3366
> 3366      if (REGNO (SET_DEST (set)) == REGNO (incr_reg))

This misses a check GET_CODE (SET_DEST (set)) == REG.

Or it could just use rtx_equal_p, i.e.
if (rtx_equal_p (SET_DEST (set), incr_reg))

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

end of thread, other threads:[~2004-01-16 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-15 19:36 trouble in attempt_auto_inc Richard Zidlicky
2004-01-16 16:48 ` Joern Rennecke

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).