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

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
> I thought there was already a bug for this, but can't find it right now.
> 

You maybe confused that with the issue abould global asm statements that go to
a random partition and cause issues with LTO?

In this case, it's not work for IPA comdat, because this is pure C code.

cgraph situation:

f/2 (f) @0x7ff1b1d73000
  Type: function definition analyzed
  Visibility: externally_visible prevailing_def_ironly public
  References: data.1957/4 (read)x/0 (read)x/0 (write)y/1 (read)y/1 (write)x/0
(read)x/0 (write)y/1 (read)y/1 (write)
  Referring: 
  Read from file: /tmp/ccRhP0dr.o
  First run: 0
  Function flags: count: 1073741826 (estimated locally)
  Called by: main/3 (1073741825 (estimated locally),1.00 per call) 
  Calls: 

data.1957/4 (data) @0x7ff1b1d71200
  Type: variable definition analyzed
  Visibility: prevailing_def_ironly
  References: 
  Referring: f/2 (read)
  Read from file: /tmp/ccRhP0dr.o
  Availability: not-ready
  Varpool flags: initialized

I suggest to extend LTO partitioning to find all functions with a computed
goto. And for these, put simply all static variables into a same partition. I
expect computed goto as quite rare feature. More fine approach would be to
investigate DECL_INITIAL for LABELs.

Honza what do you think?

Reply via email to