From: Andrew MacLeod <amacleod@redhat.com>
To: Richard Biener <richard.guenther@gmail.com>,
Trevor Saunders <tsaunders@mozilla.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [patch] Privatize gimplify_ctx structure.
Date: Wed, 20 Nov 2013 18:00:00 -0000 [thread overview]
Message-ID: <528CE3BA.7010105@redhat.com> (raw)
In-Reply-To: <CAFiYyc0a+Mn+Cr6Hqv1LMc0H_s1YV+JOyV_-2aQTKch74DeTPQ@mail.gmail.com>
On 11/20/2013 10:51 AM, Richard Biener wrote:
> On Wed, Nov 20, 2013 at 4:06 PM, Trevor Saunders <tsaunders@mozilla.com> wrote:
>> On Wed, Nov 20, 2013 at 03:18:07PM +0100, Richard Biener wrote:
>>> On Wed, Nov 20, 2013 at 3:16 PM, Jakub Jelinek <jakub@redhat.com> wrote:
>>>> On Wed, Nov 20, 2013 at 03:12:34PM +0100, Richard Biener wrote:
>>>>> The limit looks reasonable, but you could have used a simple linked
>>>>> list (and never free). Also being able to pop a random context
>>>>> looks fragile ... that is, pop_gimplify_context shouldn't have an argument.
>>>> Can't we use stack_vec<gimplify_context, 30> for that? Though that would
>>>> mean a global var constructor and destructor, so alternatively just use
>>>> a normal vec and .create(30) it somewhere during initialization?
>>> only with gimplify_context *, otherwise things will break during re-allocation.
>> hm? it seems like the only member of gimplify_ctx that can't just be
>> memcpyd is the prev pointer which presumably could go away if you have a
>> vec of all the contexts.
> Callers have a pointer to gimplify_context AFAIK.
>
>
No one except gimplify.c can have a pointer to the gimplify_context, so
its contained to within gimplify.c. Pretty much everything is based off
the current context pointer (gimplify_ctxp). There are places where the
address of a field within that context structure is passed to another
routine. If that routine then eventually triggered another
push/pop_context call, the address underneath could be changed... and
chaos ensues.
I don't know if that does happen, but it is a possibility and I dont see
the need to find out. So a simple allocation scheme has the minimal
impact on the code, and my preference is leave it as it is, or
otherwise do the simple linked list malloc-ing only as necessary....
Want me to change it, or leave it as is?
Andrew
next prev parent reply other threads:[~2013-11-20 16:31 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-20 14:11 Andrew MacLeod
2013-11-20 14:14 ` Andrew MacLeod
2013-11-20 14:18 ` Jakub Jelinek
2013-11-20 14:44 ` Andrew MacLeod
2013-11-20 18:33 ` Jeff Law
2013-11-20 18:31 ` Jeff Law
2013-11-20 15:42 ` Richard Biener
2013-11-20 15:50 ` Jakub Jelinek
2013-11-20 15:52 ` Richard Biener
2013-11-20 16:12 ` Trevor Saunders
2013-11-20 17:04 ` Richard Biener
2013-11-20 18:00 ` Andrew MacLeod [this message]
2013-11-20 18:28 ` Andrew MacLeod
2013-11-20 19:29 ` Jeff Law
2013-11-20 20:17 ` Diego Novillo
2013-11-20 20:59 ` Jeff Law
2013-11-20 21:26 ` Andrew MacLeod
2013-11-20 21:44 ` Jeff Law
2013-11-20 22:21 ` David Malcolm
2013-11-21 9:01 ` Andrew MacLeod
2013-11-20 19:35 ` Jakub Jelinek
2013-11-20 15:53 ` Andrew MacLeod
2013-11-20 16:49 ` Richard Biener
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=528CE3BA.7010105@redhat.com \
--to=amacleod@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=richard.guenther@gmail.com \
--cc=tsaunders@mozilla.com \
/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).