public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Olivier Hainque <hainque@adacore.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Olivier Hainque <hainque@adacore.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: rs6000 stack_tie mishap again
Date: Mon, 28 Mar 2016 11:23:00 -0000	[thread overview]
Message-ID: <4433372E-2AD5-4BF0-89E8-8739E64DD7B7@adacore.com> (raw)
In-Reply-To: <20160328030113.GB28596@gate.crashing.org>


> On Mar 28, 2016, at 05:01 , Segher Boessenkool <segher@kernel.crashing.org> wrote:
> 
> The normal -m32 compiler here generates code like
> 
> 	lwz 11,0(1)
> 
> and try as I might I cannot get it to fail.  Maybe because the GPR11
> setup here involves a load?

You need to have had r11 last used to designate a global
symbol as part of the function body (in order to have base_term
designate a symbol_ref etc), and then have the scheduler
decide that moving across is a good idea. It's certainly not
an easy combination to trigger.

>> We have observed this with a gcc 4.7 back-end and weren't able to reproduce
>> with a more recent version.
> 
> This makes it not a regression and thus out of scope for GCC 6.  We're
> supposed to stabilise things now ;-)

Sure, no problem if this is only for gcc 7. I posted the message
while the details were still fresh in my mind.

>> 		  if (could_be_prologue_epilogue
>> 		      && prologue_epilogue_contains (insn))
>> 		    continue;
>> 
>> The motivation for this is unclear to me.
> 
> Alan linked to the history.

Right


>  It seems clear that just considering the
> prologue is enough to fix the original problem (frame pointer setup),
> and problems like yours cannot happen in the prologue.

Right. What is unclear is if it's correct to consider only
prologues here. ISTM we arrange to produce CFI for epilogues
as well today, at least in some circumstances, and maybe the
issue Richard had with prologues at the time would need to
be addressed for epilogues as well today.

> Better would be not to have this hack at all.

Sure.

>> My rough understanding is that we probably really care about frame_related
>> insns only here, at least on targets where the flag is supposed to be set
>> accurately.
> 
> On targets with DWARF2 unwind info the flag should be set on those insns
> that need unwind info.  This does not include all insns in the epilogue
> that access the frame, so I don't think this will help you?

My idea was that, maybe, the insns we need to see for alias analysis
are precisely those for which the bit should not be set, which happened
to be exactly the case in the problematic situation we hit. But as I said,
I'm not 100% convinced the reasoning is globally correct.

>> This is the basis of the proposed patch, which essentially disconnects the
>> shortcut above for !frame_related insns on targets which need precise alias
>> analysis within epilogues, as indicated by a new target hook.
> 
> Eww.  Isn't that really all targets that schedule the epilogue at all?

Yes. Most of them use stronger barriers which the dependency analyser
knows about, so aren't affected by this. 

That's a possible alternative approach for rs6000.

Thanks for your feedback,

Olivier

  reply	other threads:[~2016-03-28 10:45 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23 16:24 Olivier Hainque
2016-03-24  7:51 ` Alan Modra
2016-03-24 10:32   ` Olivier Hainque
2016-03-24 17:00     ` Jeff Law
2016-03-28 19:58   ` Richard Henderson
2016-04-08  8:25     ` Olivier Hainque
2016-04-08 15:37       ` Segher Boessenkool
2016-04-08 16:01         ` Olivier Hainque
2016-04-11 10:15     ` Olivier Hainque
2016-04-14 15:47       ` Andreas Krebbel
2016-04-14 16:50         ` Jeff Law
2016-04-14 17:10           ` Olivier Hainque
2016-04-15  4:37             ` Andreas Krebbel
2016-04-15  7:43               ` Olivier Hainque
2016-04-15 16:42             ` Jeff Law
2016-04-15 17:05               ` Olivier Hainque
2016-04-15 17:26                 ` Segher Boessenkool
2016-04-14 22:42       ` Segher Boessenkool
2016-04-15 15:17         ` Olivier Hainque
2016-03-28  4:48 ` Segher Boessenkool
2016-03-28 11:23   ` Olivier Hainque [this message]
2016-03-28 12:44     ` Segher Boessenkool
2016-03-30  9:40       ` Olivier Hainque
2016-03-30 15:15         ` Alan Modra
2016-03-23 17:42 David Edelsohn
2016-03-24  8:17 ` Alan Modra
2016-03-24 10:17   ` Olivier Hainque

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4433372E-2AD5-4BF0-89E8-8739E64DD7B7@adacore.com \
    --to=hainque@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).