This is the mail archive of the
mailing list for the GCC project.
Re: No TBAA before ptr_derefs_may_alias_p?
- From: Florian Weimer <fweimer at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>, Bingfeng Mei <bmei at broadcom dot com>
- Cc: Richard Biener <rguenther at suse dot de>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Mon, 03 Feb 2014 11:14:24 +0100
- Subject: Re: No TBAA before ptr_derefs_may_alias_p?
- Authentication-results: sourceware.org; auth=none
- References: <B71DF1153024A14EABB94E39368E44A604269C31 at SJEXCHMB13 dot corp dot ad dot broadcom dot com> <52EBC010 dot 5030409 at suse dot de> <B71DF1153024A14EABB94E39368E44A604269DAC at SJEXCHMB13 dot corp dot ad dot broadcom dot com> <783352a3-eb4d-467a-82bd-8cca90f74a30 at email dot android dot com> <B71DF1153024A14EABB94E39368E44A60427497B at SJEXCHMB13 dot corp dot ad dot broadcom dot com> <20140203095938 dot GF892 at tucnak dot redhat dot com>
On 02/03/2014 10:59 AM, Jakub Jelinek wrote:
On Mon, Feb 03, 2014 at 09:51:01AM +0000, Bingfeng Mei wrote:
If it is just for C++ placement new, why don't implement it as a lang_hook.
Now other languages such as C have to be made conservative and produce worse
Even in C++ code you don't use placement new that often, so e.g. by having
the placement new explicit through some special GIMPLE statement in the IL,
you could e.g. just look if a particular function or loop contains any
placement new stmts (cached in struct function and loop?) and use TBAA if
it isn't there.
I believe the convenience of TBAA lies in the fact that you don't have
to prove anything about actual program behavior if the types are
sufficiently distinct. If you allow local violations of that principle,
the global property inevitably breaks down as well.
In any case, C code can call C++ code and vice versa, so it's difficult
to consider each language in isolation.
Florian Weimer / Red Hat Product Security Team