[flang] Add TODO for creation of polymorphic temporary
The current code is wrong: it is doing an alloca with the declared type instead of the dynamic type, leading to undefined behavior when the dynamic type and declared type differ and the temporary is later used. This also introduces some `fir.alloca none` for unlimited polymorphic that are not allocating the right thing at all. Add TODOs for now, the correct thing to do will probably be to use the runtime (like AssignTemporary), but since this happens in code doing "mold" temp allocation, I first need to check if there is a need for "mold" temporary creation not followed by an assign, or if this can be combined with the assign instead (for HLFIR, it is pretty easy combine this from as_expr codegen, not sure for the current lowering). Differential Revision: https://reviews.llvm.org/D147333
Loading
Please sign in to comment