On 2018-12-05 2:38 p.m., Michael Ploujnikov wrote: > Hi, > > I'm trying to write a testcase to reproduce duplicate clone symbols > such as in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88297 I > started with a testcase that is known to have constprop clones and > split it into two object files: > > > bash-4.2# cat /gcc/src/gcc/testsuite/gcc.dg/lto/independent-cloneids-lto_0.c > /* { dg-require-effective-target lto } */ > /* { dg-lto-options {{-O3 -fipa-cp -fipa-cp-clone}} } */ > /* { dg-lto-do run } */ > > #include <stdio.h> > > extern int foo (int arg); > extern int bar (int arg); > int __attribute__ ((noinline)) > foo (int arg) > { > return 7 * arg; > } > > int __attribute__ ((noinline)) > bar (int arg) > { > return arg * arg; > } > > int main (void) > { > printf("%d\n", bar (3)); > printf("%d\n", bar (4)); > printf("%d\n", foo (5)); > printf("%d\n", foo (6)); > return 0; > } > > bash-4.2# cat /gcc/src/gcc/testsuite/gcc.dg/lto/independent-cloneids-lto_1.c > int __attribute__ ((noinline)) > foo (int arg) > { > return 7 * arg; > } > > int __attribute__ ((noinline)) > bar (int arg) > { > return arg * arg; > } > > but now decide_whether_version_node does not call decide_about_value > and I don't know enough about ipa/lattices to figure out what's > missing. Any help would be appreciated. > > > - Michael >
If I print out the lattices in decide_whether_version_node right before the call to gather_context_independent_values (and some more info within the loop and after) I see: debug: decide_whether_version_node - node: bar count is 1 Lattices: Node: main/13: Node: bar/12: param [0]: BOTTOM ctxs: BOTTOM Bits unusable (BOTTOM) VARYING AGGS BOTTOM Node: foo/11: param [0]: BOTTOM ctxs: BOTTOM Bits unusable (BOTTOM) VARYING AGGS BOTTOM debug: decide_whether_version_node - !lat->bottom: 0 debug: decide_whether_version_node - !plats->aggs_bottom: 0 debug: decide_whether_version_node - node : bar info->do_clone_for_all_contexts: 0 debug: decide_whether_version_node - node: foo count is 1 Lattices: Node: main/13: Node: bar/12: param [0]: BOTTOM ctxs: BOTTOM Bits unusable (BOTTOM) VARYING AGGS BOTTOM Node: foo/11: param [0]: BOTTOM ctxs: BOTTOM Bits unusable (BOTTOM) VARYING AGGS BOTTOM debug: decide_whether_version_node - !lat->bottom: 0 debug: decide_whether_version_node - !plats->aggs_bottom: 0 debug: decide_whether_version_node - node : foo info->do_clone_for_all_contexts: 0
signature.asc
Description: OpenPGP digital signature