public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Change initialization order in sel-sched
@ 2012-04-11 14:19 Bernd Schmidt
  2012-04-11 14:21 ` Richard Guenther
  0 siblings, 1 reply; 4+ messages in thread
From: Bernd Schmidt @ 2012-04-11 14:19 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 280 bytes --]

The order of calls to sched_rgn_init and sched_init differs between
sched-rgn and sel-sched. This caused a scheduler patch I was working on
to segfault once sel-sched was enabled. The following patch swaps the
two function calls.

Bootstrapped & tested on i686-linux. Ok?


Bernd

[-- Attachment #2: selfix.diff --]
[-- Type: text/plain, Size: 524 bytes --]

	* sel-sched.c (sel_global_init): Swap order of sched_rgn_init and
	sched_init calls.

Index: gcc/sel-sched.c
===================================================================
--- gcc/sel-sched.c	(revision 364953)
+++ gcc/sel-sched.c	(working copy)
@@ -7616,8 +7616,8 @@ sel_global_init (void)
   sel_setup_sched_infos ();
   setup_sched_dump ();
 
-  sched_rgn_init (false);
   sched_init ();
+  sched_rgn_init (false);
 
   sched_init_bbs ();
   /* Reset AFTER_RECOVERY if it has been set by the 1st scheduler pass.  */

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

* Re: Change initialization order in sel-sched
  2012-04-11 14:19 Change initialization order in sel-sched Bernd Schmidt
@ 2012-04-11 14:21 ` Richard Guenther
  2012-04-17 13:34   ` Alexander Monakov
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Guenther @ 2012-04-11 14:21 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: GCC Patches

On Wed, Apr 11, 2012 at 4:16 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> The order of calls to sched_rgn_init and sched_init differs between
> sched-rgn and sel-sched. This caused a scheduler patch I was working on
> to segfault once sel-sched was enabled. The following patch swaps the
> two function calls.
>
> Bootstrapped & tested on i686-linux. Ok?

Ok.

Thanks,
Richard.

>
> Bernd

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

* Re: Change initialization order in sel-sched
  2012-04-11 14:21 ` Richard Guenther
@ 2012-04-17 13:34   ` Alexander Monakov
  2012-04-17 13:38     ` Bernd Schmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Monakov @ 2012-04-17 13:34 UTC (permalink / raw)
  To: Richard Guenther; +Cc: Bernd Schmidt, GCC Patches, Andrey Belevantsev


On Wed, 11 Apr 2012, Richard Guenther wrote:

> On Wed, Apr 11, 2012 at 4:16 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> > The order of calls to sched_rgn_init and sched_init differs between
> > sched-rgn and sel-sched. This caused a scheduler patch I was working on
> > to segfault once sel-sched was enabled. The following patch swaps the
> > two function calls.
> >
> > Bootstrapped & tested on i686-linux. Ok?
> 
> Ok.
> 
> Thanks,
> Richard.

Actually, this causes miscompilations with selective scheduler when
-fsel-sched-pipelining is enabled (as it is with -O3 on ia64).  The reason is,
with that flag we build custom regions that consist of a loop body and its
preheader in sel_find_rgns, which is called from sched_rgn_init.  We require
that sched_init is called afterwards, so that DF data is computed for any new
blocks that might have been created (i.e. preheaders); it's possible that DF
is not the only thing that forces this order.

Bernd, could you elaborate on the segfault you had seen?  Perhaps we could
offer some advice on fixing it then.

In the meanwhile, could you revert your patch?  I'm sorry to point out this
problem after the patch had been committed, but it's not immediately obvious :)
Andrey or I will add an explanatory comment in sel-sched afterwards.

Alexander

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

* Re: Change initialization order in sel-sched
  2012-04-17 13:34   ` Alexander Monakov
@ 2012-04-17 13:38     ` Bernd Schmidt
  0 siblings, 0 replies; 4+ messages in thread
From: Bernd Schmidt @ 2012-04-17 13:38 UTC (permalink / raw)
  To: Alexander Monakov; +Cc: Richard Guenther, GCC Patches, Andrey Belevantsev

On 04/17/2012 03:33 PM, Alexander Monakov wrote:
> Bernd, could you elaborate on the segfault you had seen?  Perhaps we could
> offer some advice on fixing it then.

It was only seen with another patch which modified the sched-rgn
initialization code.

> In the meanwhile, could you revert your patch?  I'm sorry to point out this
> problem after the patch had been committed, but it's not immediately obvious :)
> Andrey or I will add an explanatory comment in sel-sched afterwards.

Will revert for now. In general I think it would be better to change
sel-sched so that the init functions can always be called in the same
order, so as to avoid unnecessary surprises.


Bernd

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

end of thread, other threads:[~2012-04-17 13:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-11 14:19 Change initialization order in sel-sched Bernd Schmidt
2012-04-11 14:21 ` Richard Guenther
2012-04-17 13:34   ` Alexander Monakov
2012-04-17 13:38     ` Bernd Schmidt

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