This is the mail archive of the
mailing list for the GCC project.
Re: [unit-at-a-time] Java inlining woes
> Scenario: Function b is inlined into a, a is expanded before b.
> Everything goes nicely until:
> OSC.java:9: internal compiler error: in add_abstract_origin_attribute, at
> Function a clones VAR_DECL's from b, setting abstract origin accordingly.
> But the origin DIE doesn't exist yet, so when we gen_decl_die(a)...
> This only happens in my patched tree, since without unit-at-a-time, the
> function tree doesn't exist until just before it is expanded. And with
> unit-at-a-time it is rare, since the inlined-from functions are generally
> expanded first. (In my complete example, a calls b and b calls a.)
> How does this work in other languages? I'm wondering about e.g. "extern
> inline" where I'd guess the function is also not expanded before its body
> is cloned.
I am not 100% sure I understand your problem, but in general, the
function expansion is supposed to be mostly noop on the program
rerpesentation tree so functions can be expanded at any time with no
interference with inlining them or expanding others.
For C/C++ frontends this works in majority of cases except for nested
function where the nested functions must be expanded after the main
function body. At the moment I work around by dealing with nested
functions as kind of meta-function but in future I would like to clean
Perhaps you can manage the data structures to be initialized during