On Mon Jan 9 22:06:12 2023 +0000, Zebediah Figura wrote:
I'm afraid I disagree with this analysis quite strongly. While we *can* do copy-prop this way, there's fundamentally no reason why we can't copy-prop from a temporary object variable, making this code look questionable already. Worse, I think it's a lot less clear why this prevents an infinite loop, compared to Francisco's initial approach.
In my understanding, the fundamental reason why we cannot propagate from a temporary object is that temporary objects do not really exist. They are just a static kind of pointer. The only objects that exist really, AFAIU the language, are those represented by a uniform variable (which is later given a register type and number). All other object variables must be resolved at compilation time to a uniform object, or the program is to be rejected. From this point of view the thing that is meaningful to track is the underlying real uniform object, and once you adopt this point of view the bug just isn't there any more.
Actually, that would probably be an argument for moving the `!is_uniform` check to `copy_propagation_record_store()`. The copy propagation tables themselves should contain no record of a store coming from a temporary object variable, for the reason above.
Suspecting that you won't agree with me anyway, I guess you're the one to decide, and I agree that solving the bug in the way I don't like is still better than not solving it at all.