public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* PPC EH failure
@ 2002-03-07  8:01 Jan Hubicka
  2002-03-07 10:46 ` Richard Henderson
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Hubicka @ 2002-03-07  8:01 UTC (permalink / raw)
  To: gcc, rth, gcc-bugs

Hi,
the scheduler in PPC construct:
;; Basic block 31, loop depth 0, count 0
;; Predecessors:  30 [50.0%]  (fallthru)
;; Registers live at start: 0 [0] 1 [1] 26 [26] 27 [27] 28 [28] 30 [30] 31 [31]
67 [ap]
(note 902 571 572 [bb 31] NOTE_INSN_BASIC_BLOCK)
(insn 572 902 1049 (set (mem/s/j:HI (plus:SI (reg/v/f:SI 26 r26 [195])
                (const_int 42 [0x2a])) [0 <variable>.vtable_method_count+0 S2 A16])
        (reg:HI 0 r0 [230])) 296 {*rs6000.md:7725} (nil)
    (expr_list:REG_DEAD (reg:HI 0 r0 [230])
        (expr_list:REG_EH_REGION (const_int 1 [0x1])
            (nil))))
(insn 1049 572 573 (use (symbol_ref:SI ("_ZN4java4lang6Object6class$E"))) -1 (nil)
    (nil))
;; Registers live at end: 1 [1] 26 [26] 27 [27] 28 [28] 30 [30] 31 [31] 67 [ap]
;; Successors:  32 [50.0%]  (fallthru) 78 [50.0%]  (ab,eh)

making my checking to fail.  It is obviously incorrect to move the use
after EH_REGION insn and sheduler already do contain code:
  /* If this instruction can throw an exception, then moving it changes
     where block boundaries fall.  This is mighty confusing elsewhere.
     Therefore, prevent such an instruction from being moved.  */
  if (can_throw_internal (insn))
    reg_pending_barrier = true;
that does care it, but it does not hit on use as it barriers only registers,
not the rest.  I am probably going to fix it by calling fixup_abnormal_edges,
but the question is whether this hunk should to go and whether such fix
is OK - it is definitly OK for local movement, but we should probably prevent
somewhere the global movement to avoid confussion.

Honza

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

* Re: PPC EH failure
  2002-03-07  8:01 PPC EH failure Jan Hubicka
@ 2002-03-07 10:46 ` Richard Henderson
  2002-03-08 12:12   ` Jan Hubicka
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Henderson @ 2002-03-07 10:46 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: gcc, gcc-bugs

On Thu, Mar 07, 2002 at 05:01:42PM +0100, Jan Hubicka wrote:
> It is obviously incorrect to move the use
> after EH_REGION insn and sheduler already do contain code:
>   /* If this instruction can throw an exception, then moving it changes
>      where block boundaries fall.  This is mighty confusing elsewhere.
>      Therefore, prevent such an instruction from being moved.  */
>   if (can_throw_internal (insn))
>     reg_pending_barrier = true;
> that does care it, but it does not hit on use as it barriers only registers,

Grr.  Ok, fix this by changing sched-rgn.c add_branch_dependences

  while (GET_CODE (insn) == CALL_INSN
         || GET_CODE (insn) == JUMP_INSN
         || (GET_CODE (insn) == INSN
             && (GET_CODE (PATTERN (insn)) == USE
                 || GET_CODE (PATTERN (insn)) == CLOBBER
+		 || can_throw_internal (insn)
#ifdef HAVE_cc0
                 || sets_cc0_p (PATTERN (insn))
#endif
             ))
         || GET_CODE (insn) == NOTE)



r~

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

* Re: PPC EH failure
  2002-03-07 10:46 ` Richard Henderson
@ 2002-03-08 12:12   ` Jan Hubicka
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Hubicka @ 2002-03-08 12:12 UTC (permalink / raw)
  To: Richard Henderson, Jan Hubicka, gcc, gcc-bugs

> On Thu, Mar 07, 2002 at 05:01:42PM +0100, Jan Hubicka wrote:
> > It is obviously incorrect to move the use
> > after EH_REGION insn and sheduler already do contain code:
> >   /* If this instruction can throw an exception, then moving it changes
> >      where block boundaries fall.  This is mighty confusing elsewhere.
> >      Therefore, prevent such an instruction from being moved.  */
> >   if (can_throw_internal (insn))
> >     reg_pending_barrier = true;
> > that does care it, but it does not hit on use as it barriers only registers,
> 
> Grr.  Ok, fix this by changing sched-rgn.c add_branch_dependences
> 
>   while (GET_CODE (insn) == CALL_INSN
>          || GET_CODE (insn) == JUMP_INSN
>          || (GET_CODE (insn) == INSN
>              && (GET_CODE (PATTERN (insn)) == USE
>                  || GET_CODE (PATTERN (insn)) == CLOBBER
> +		 || can_throw_internal (insn)

I see.  Would you mind installing the change? I am on the trip right now
with limited time for gcc...

Thanks! I expected there must be something I missed.
Honza

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

end of thread, other threads:[~2002-03-08 20:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-07  8:01 PPC EH failure Jan Hubicka
2002-03-07 10:46 ` Richard Henderson
2002-03-08 12:12   ` Jan Hubicka

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