nayakgi / perl-compiler

Automatically exported from code.google.com/p/perl-compiler
Other
0 stars 0 forks source link

CC: Warning: unresolved $section symbol s\\xxx #110

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
pb -MO=CC,-v,-obinarytrees.perl.c ../shootout/bench/binarytrees/binarytrees.perl

vs 

pb -MO=C,-v,-obinarytrees.perl.c ../shootout/bench/binarytrees/binarytrees.perl

Some ENTERSUB op fields are empty because those symbols were never visited, 
such as op->next and op->first.

    { 0, 0, /*OP_ENTERSUB*/NULL, 9, 173, 0, 1, 0, 0, 0, 0x46, 0x21, 0 }, /* unop_list[2] */
vs.
    { &op_list[8], &op_list[8], /*OP_ENTERSUB*/NULL, 9, 173, 0, 1, 0, 0, 0, 0x46, 0x21, (OP*)&unop_list[4] }, /* unop_list[3] */

Original issue reported on code.google.com by reini.urban on 15 Oct 2012 at 3:59

GoogleCodeExporter commented 9 years ago
Fixed with 91b6646

Save ENTERSUB next and first fields
first is not not needed as its generally NULL, 
but next is needed to end the ENTERSUB loop (here unop_list[2])

    DOOP(PL_ppaddr[OP_ENTERSUB]);
    while (PL_op != ((OP*)&unop_list[2])->op_next &&  PL_op != (OP*)0 ){
        PL_op = (*PL_op->op_ppaddr)(aTHX);
        SPAGAIN;}

I keep the unresolved $section symbol s\\xxx warning with verbose but added
a better description.

This is most likely a critical internal compiler bug, esp. if in
With B::C this is most likely a critical internal compiler bug, esp. if in
an op section.
With B::CC it can be caused by valid optimizations, e.g. when op->next
pointers were inlined or inlined GV or CONST ops were optimized away.

Original comment by reini.urban on 15 Oct 2012 at 8:42