On Sat, Apr 16, 2016 at 9:47 AM, Jan Hubicka <hubi...@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.