`-O` affects selection of overlapping instances
See https://gist.github.com/viercc/eb6a4231636f91c89ee934d0ae425ba2:
$ ./main.o0 # compiled with -O0
outer:outer:
inner:outer:
$ ./main.o1 # compiled with -O1
top:top:
top:top:
Expected behaviour would be one with -O0
- possible solutions:
- find combination of flags that preserves behaviour we want
- investigate possibility of using plugin to prevent unwanted optimization in context of FCI
- restrict interface to avoid these situations
I'm personally inclined to 1. or 2.. reflection
may be source of inspiration with this issue, though AFAIK they simply choose 3. in all cases.
Relevant flags (not exhaustive):
Edited by TheMatten