public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Why does IRA force all pseudos live across a setjmp call to be spilled?
@ 2018-03-02 19:45 Peter Bergner
  2018-03-02 19:55 ` Alexander Monakov
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Peter Bergner @ 2018-03-02 19:45 UTC (permalink / raw)
  To: GCC; +Cc: Vladimir N Makarov, Pat Haugen

While debugging the PR84264 ICE caused by the following test case:

  void _setjmp ();
  void a (unsigned long *);
  void
  b ()
  {
    for (;;)
      {
	_setjmp ();
	unsigned long args[9]{};
	a (args);
      }
  }

I noticed that IRA is spilling all pseudos that are live across the call
to setjmp.  Why is that?  Trying to look through the history of this, I see
Jim committed a patch to reload that removed it spilling everything across
all setjmps:

  https://gcc.gnu.org/ml/gcc-patches/2003-11/msg01667.html

But currently ira-lives.c:process_bb_node_lives() has:

  /* Don't allocate allocnos that cross setjmps or any
     call, if this function receives a nonlocal
     goto.  */
  if (cfun->has_nonlocal_label
      || find_reg_note (insn, REG_SETJMP,
			NULL_RTX) != NULL_RTX)
    {
      SET_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj));
      SET_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj));
    }

...which forces us to spill everything live across the setjmp by forcing
the pseudos to interfere all hardregs.  That can't be good for performance.
What am I missing?

Peter


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

end of thread, other threads:[~2018-03-06 16:20 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-02 19:45 Why does IRA force all pseudos live across a setjmp call to be spilled? Peter Bergner
2018-03-02 19:55 ` Alexander Monakov
2018-03-02 21:26 ` Jeff Law
2018-03-03  3:28   ` Peter Bergner
2018-03-03 16:29     ` Jeff Law
2018-03-03 23:47       ` Peter Bergner
2018-03-04  0:30         ` Peter Bergner
2018-03-04  8:57           ` Richard Biener
2018-03-04  9:11             ` Andreas Schwab
2018-03-05  2:12             ` Jeff Law
2018-03-04 13:57         ` Eric Botcazou
2018-03-04 16:40           ` Peter Bergner
2018-03-04 17:39             ` Andreas Schwab
2018-03-05  0:16           ` Segher Boessenkool
2018-03-05  7:01             ` Eric Botcazou
2018-03-05  7:09               ` Eric Botcazou
2018-03-05 15:33               ` Segher Boessenkool
2018-03-05 16:18                 ` Eric Botcazou
2018-03-06 16:20                 ` Peter Bergner
2018-03-03  3:21 ` Vladimir Makarov

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