On Wed, Jan 4, 2017 at 2:08 PM, Alexandre Oliva <aol...@redhat.com> wrote: > On Jan 4, 2017, Richard Biener <richard.guent...@gmail.com> wrote: > >> On Tue, Jan 3, 2017 at 6:29 AM, Alexandre Oliva <aol...@redhat.com> wrote: >>> If we include them in the ICF hash, they may cause congruence_groups to >>> be processed in a different order due to different hashes, which in turn >>> causes different funcdef_nos to be assigned to functions. Since these >>> numbers are included in -fcompare-debug dumps, they cause failures. > >> Is this because ICF simply compares all optimize/target options? > >> So it boils down to -g implying -fvar-tracking but -g0 not? > > Not quite. It would be the same if -g or any other option that > shouldn't affect the executable code output were used to compute that > hash. -g is not among those flags, why should flags that adds detail to > it be? (Really, -fvar-tracking should have been a -g subflag rather > than an -f one) > >> I don't think this is ok -- 'Optimization' doesn't really mean optimization >> but sth we can control per-function. You essentially remove the ability >> to disable var-tracking just for a single (bad) function. > > I see the proposed patch does that indeed. There are other ways to > accomplish that (disabling var-tracking for a single function), but I > suppose a direct way is important. So I guess we need some alternate > PerFunction option flag that makes it per-function, but not part of the > ICF hash?
Yeah, I suppose ICF cares about those flags for the same reason the inliner does -- just the inliner does it more fine-grained. I suppose "[un]setting" opt[12]->x_flag_var_tracking before/after hash compute and comparison does the trick (with a big fat comment). That said, the inliner has all the explicit check_maybe_up/down checks looking for options that make semantic differences and honors explicit attribute "optimized" 1:1. But I guess that's nothing we can change ICF to for GCC 7. Martin? Thanks, Richard. > > -- > Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ > You must be the change you wish to see in the world. -- Gandhi > Be Free! -- http://FSFLA.org/ FSF Latin America board member > Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer