From: Jan Hubicka <hubicka@ucw.cz>
To: Richard Biener <rguenther@suse.de>
Cc: Jan Hubicka <hubicka@ucw.cz>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fix PR66705
Date: Thu, 03 Sep 2015 08:54:00 -0000 [thread overview]
Message-ID: <20150903085010.GC47408@kam.mff.cuni.cz> (raw)
In-Reply-To: <alpine.LSU.2.11.1509021629230.5523@zhemvz.fhfr.qr>
> > supplied by foreign code, so you need to be conservative anyway.
>
> I use all_refs_explicit_p () to go a conservative path. And indeed
Yep, that should be safe.
I guess you want two things
1) discover any possible ADDR_REF of a given symbol with all_refs_explicit_p.
For that you want walk referring list of the symbol or if you go forward
direction walk all initializers of all non-aliases you can see as all of them
may possibly reffer to it.
2) discover what static variables you have fully in control and know all
references to. I suppose that is where you use all_refs_explicit_p
Explicit reference may be also an alias that may be exported.
all_refs_explicit_p cares about symbol, not about the initializer itself,
so you may want to have a version of this predicate that walks all aliases
and checks that all of them have all refs explicit.
> I may trip aliases (well, the code doesn't handle aliases correctly
> anyway I guess - I just walk vars via
>
> /* Create constraints for global variables and their initializers. */
> FOR_EACH_VARIABLE (var)
> {
> if (var->alias && var->analyzed)
> continue;
>
> get_vi_for_tree (var->decl);
> }
>
> and in get_vi_for_tree look at its ref list. So I should only get
> "ultimate" alias targets and only those may have initializers?
Yep, only ulitmate alias targets have initializers.
Honza
>
> Richard.
next prev parent reply other threads:[~2015-09-03 8:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-02 12:59 Richard Biener
2015-09-02 13:03 ` Jan Hubicka
2015-09-02 13:32 ` Richard Biener
2015-09-02 13:45 ` Richard Biener
2015-09-02 14:23 ` Jan Hubicka
2015-09-02 14:31 ` Richard Biener
2015-09-03 8:54 ` Jan Hubicka [this message]
2015-09-02 14:25 ` Jan Hubicka
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=20150903085010.GC47408@kam.mff.cuni.cz \
--to=hubicka@ucw.cz \
--cc=gcc-patches@gcc.gnu.org \
--cc=rguenther@suse.de \
/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).