On Mon, Mar 30, 2015 at 11:07 AM, Jan Hubicka <hubi...@ucw.cz> wrote: > Hi, > unforutnately the patch ICE on: > int i; > struct C > { > C(); > }; > > C::C() > { > static void *labelref = &&label; > goto *labelref; > label: i = 1; > } > > int main() > { > C c; > return (i != 1); > } > > The problem is that decl_function_context of labelref is not C::C > itself but an abstract function that is abstract origin of C::C. > Jaosn, I suppose this is an artefact of constructor clonning? > Function like this can not be clonned without duplicating label, > is the decl_function_context really intended to be the abstract one?
IMHO that's bogus. But I thought we decided that functions with non-local labels shouldn't be cloned? ISTR people collecting such labels in some global array (kernel folks?) and thus definitely don't expect labels to multiply. And cloning static vars looks bogus as well as the addresses of the vars need to compare equal (return &labelref, call the fn two times, reaching different clones and abort if the return value isn't equal). Richard. > Honza