[Bug ipa/67051] New: symtab_node::equal_address_to too conservative?

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jul 29 08:44:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67051

            Bug ID: 67051
           Summary: symtab_node::equal_address_to too conservative?
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
                CC: hubicka at gcc dot gnu.org
  Target Milestone: ---

For

int i;
int j;

symtab_node::equal_address_to says "no" to &i == &j.  This seems to be because
i and j are 'common' and decl_binds_to_current_def_p returns false.

But I don't see how a valid testcase could alias i and j in another translation
unit.  Yes, they can be interposed.

Probably this is

  /* TODO: Alias oracle basically assume that addresses of global variables
     are different unless they are declared as alias of one to another.
     We probably should be consistent and use this fact here, too, and update
     alias oracle to use this predicate.  */

?


This makes us fail to optimize conditionals like &i != &j



More information about the Gcc-bugs mailing list