This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix pure/const discovery WRT interposition part 2
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 13 Jun 2016 11:30:55 -0700
- Subject: Re: Fix pure/const discovery WRT interposition part 2
- Authentication-results: sourceware.org; auth=none
- References: <20160416164707 dot GA63314 at kam dot mff dot cuni dot cz>
On Sat, Apr 16, 2016 at 9:47 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> Hi,
> this patch updates ipa-pure-const.c to only propagate PURE flag across
> calls that does not bind to local defs and are not explicitly declared const.
> This gets memory state into shape that the callee produced by other compiler
> and still accessing memory is safe.
>
> We need similar logic for -fnon-call-exceptions which I will do incrementally.
> We also want to track if the original unoptimized body did access memory but
> that needs frontend changes because memory accesses may get folded away during
> parsing.
>
> Bootstrapped/regtested x86_64-linux, will commit it shortly.
>
> Honza
>
> PR ipa/70018
> * cgraph.c (cgraph_set_const_flag_1): Only set as pure if
> function does not bind to current def.
> * ipa-pure-const.c (worse_state): Add FROM and TO parameters;
> handle conservatively calls to functions that does not need to bind
> to current def.
> (check_call): Update call of worse_state.
> (ignore_edge_for_nothrow): Update.
> (ignore_edge_for_pure_const): Likewise.
> (propagate_pure_const): Update calls to worse_state.
> (skip_function_for_local_pure_const): Reformat comments.
>
This cased:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71524
H.J.