public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: Jakub Jelinek <jakub@redhat.com>, Alan Modra <amodra@gmail.com>,
	       Andreas Schwab <schwab@linux-m68k.org>,
	       Bernd Schmidt <bschmidt@redhat.com>,
	       GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] PR69195, Reload confused by invalid reg equivs
Date: Mon, 14 Mar 2016 19:00:00 -0000	[thread overview]
Message-ID: <56E70A57.6020305@redhat.com> (raw)
In-Reply-To: <CAFiYyc2ULPL3n4+xuc73DfDr+-EJpFKJDkENvX5cJVdfM0gbxw@mail.gmail.com>

On 03/14/2016 03:56 AM, Richard Biener wrote:

>> Undefined?  Most likely.  But we still have to do something sensible. As
>> Jakub noted, a user could create the problematic code just as easily as
>> DCE/DSE, so IRA probably needs to be tolerant of this situation.
>>
>> So it seems like you're suggesting we leave DCE/DSE alone (declaring this
>> usage undefined) and fix IRA to be tolerant, right?
>
> Tolerant as in not crash?  Yes.
Right.  Tolerant as in not crash.

>
>>> Using alloca to create/jump to code on the stack should work (we might
>>> transform that into a decl though).
>>
>> Given that executable stacks are a huge security hole, I'd be willing to go
>> out on a limb and declare that undefined as well.  It's not as clear cut,
>> but that's the argument I'd make.
>
> Well, I thought about somebody trying to build trampolines in a way exposed
> to GCC.
Right or other dynamic, short-lived code fragments.

>
>> And yes, I realize that goes in opposition to what GCC has allowed for 20+
>> years.  I still think it'd be the right thing to do.
>
> Did we allow this?  Not by design but rather by accident I suppose.
I don't think it was ever specifically allowed or disallowed; like many 
of the old extensions, it was never crisply defined.

I can distinctly remember having to declare that taking the address of a 
blob of code on the stack, then calling/jumping to it after the 
containing function went out of scope as undefined.  I think it was the 
address of a trampoline, but I'm not entirely sure -- there's a small 
chance it was user-created code.  I only remember it because I was 
surprised at how controversial it was to declare that as undefined :(

That most likely predates egcs, so the discussion is not likely in the 
public archives.  It may have been a private discussion between Kenner, 
Jim, Doug and myself or some subset thereof.


jeff

  reply	other threads:[~2016-03-14 19:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-04 14:54 [RFC] " Alan Modra
2016-03-04 17:40 ` Bernd Schmidt
2016-03-07 14:47   ` Alan Modra
2016-03-10  9:18     ` [PATCH] " Alan Modra
2016-03-10  9:48       ` Bernd Schmidt
2016-03-11 20:40       ` Andreas Schwab
2016-03-11 22:16         ` Alan Modra
2016-03-11 23:13           ` Alan Modra
2016-03-12  7:58             ` Jakub Jelinek
2016-03-12  8:26               ` Jeff Law
2016-03-12  9:07                 ` Alan Modra
2016-03-12  9:29                   ` Jakub Jelinek
2016-03-12 11:10                     ` Richard Biener
2016-03-12 17:07                       ` Jeff Law
2016-03-14  9:56                         ` Richard Biener
2016-03-14 19:00                           ` Jeff Law [this message]
2016-03-15  2:27                             ` Alan Modra
2016-03-15 12:17                               ` Bernd Schmidt

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=56E70A57.6020305@redhat.com \
    --to=law@redhat.com \
    --cc=amodra@gmail.com \
    --cc=bschmidt@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=richard.guenther@gmail.com \
    --cc=schwab@linux-m68k.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).