Noticed the bug while preparing -fno-topelvel-reorder patch for Andi. With WIP version of patch I got following failure building Mozilla: /tmp/ccPpJShB.ltrans29.ltrans.o:ccPpJShB.ltrans29.o:function _ZZN2js9InterpretEP9JSContextPNS_10StackFrameENS_10InterpModeEE15normalJumpTable.7094572: error: undefined reference to +'.L79667' /tmp/ccPpJShB.ltrans29.ltrans.o:ccPpJShB.ltrans29.o:function _ZZN2js9InterpretEP9JSContextPNS_10StackFrameENS_10InterpModeEE15normalJumpTable.7094572: error: undefined reference to +'.L79668' /tmp/ccPpJShB.ltrans29.ltrans.o:ccPpJShB.ltrans29.o:function _ZZN2js9InterpretEP9JSContextPNS_10StackFrameENS_10InterpModeEE15normalJumpTable.7094572: error: undefined reference to +'.L79669' /tmp/ccPpJShB.ltrans29.ltrans.o:ccPpJShB.ltrans29.o:function _ZZN2js9InterpretEP9JSContextPNS_10StackFrameENS_10InterpModeEE15normalJumpTable.7094572: error: undefined reference to +'.L79670' /tmp/ccPpJShB.ltrans29.ltrans.o:ccPpJShB.ltrans29.o:function _ZZN2js9InterpretEP9JSContextPNS_10StackFrameENS_10InterpModeEE15normalJumpTable.7094572: error: undefined reference to +'.L79671' We will need artificial testcase for that that is bit tricky because it involves putting function into one partition and its local static variable into another, but clearly ipa-reference is not recording the cases where address of local label is taken and thus partitioning happily breaks such code. Honza
Have a look at PR50620. I can provide 30 different testcases for this issue ;-).
> Have a look at PR50620. I can provide 30 different testcases > for this issue ;-). Those are different problems (i.e. not involving labels with address taken). I will look into that now. Honza
Just hit the same problem today: ... /tmp/ccNz0HZT.ltrans29.ltrans.o:ccNz0HZT.ltrans29.o:function _ZZN2js9InterpretEP9JSContextPNS_10StackFrameENS_10InterpModeEE15normalJumpTable.98063: error: undefined reference to '.L3709' /tmp/ccNz0HZT.ltrans29.ltrans.o:ccNz0HZT.ltrans29.o:function _ZZN2js9InterpretEP9JSContextPNS_10StackFrameENS_10InterpModeEE15normalJumpTable.98063: error: undefined reference to '.L3710' /tmp/ccNz0HZT.ltrans29.ltrans.o:ccNz0HZT.ltrans29.o:function _ZZN2js9InterpretEP9JSContextPNS_10StackFrameENS_10InterpModeEE15normalJumpTable.98063: error: undefined reference to '.L3711' ...
*** Bug 61635 has been marked as a duplicate of this bug. ***
Patch posted https://gcc.gnu.org/ml/gcc-patches/2015-03/msg01526.html
The patch doesn't seem to be checked in yet. Is there a reason for that?
(In reply to Andi Kleen from comment #6) > The patch doesn't seem to be checked in yet. Is there a reason for that? Maybe people just forgot about it?
*** Bug 83375 has been marked as a duplicate of this bug. ***
Simple testcase from the other bug: /* { dg-do link } */ /* { dg-options "-flto-partition=max -flto -O2" } */ /* { dg-require-effective-target lto } */ /* Test for putting static with label references into same LTO partition */ int x, y; void f(int i) { typedef void *ptr; static ptr data[] = {&&l1,&&l2,&&l3,&&l4}; goto *data[i]; l1: x++; l2: y++; l3: x--; l4: y--; } int main(void) { f(x); return 0; }