> At -O3 the unused 'c' remains. Likely different (recursive?) inlining makes > us > process a cgraph cycle in different order and thus fail to elide the output > of 'c' (it's output first at -O3). > > Fixing that would need processing cgraph SCCs with an extra IPA phase in main > optimization so we get a chance to do extra node removal (maybe order > the cycles so that functions we can elide - aka static ones - are processed > last). That would tamper with optimizations that propagate from callee to caller during late optimization, like IPA register allocation, stack alignment propagation or late pure/const discovery.
Honza