Closed
Description
by definition of deref
attribute in LifetimeCheckPass::checkLoad
// Only interested in checking deference on top of pointer types.
// Note that usually the use of the invalid address happens at the
// load or store using the result of this loadOp.
given the c++ code:
int simple = *p;
we get cir:
%11 = cir.load deref align(8) %0 : !cir.ptr<!cir.ptr<!s32i>>, !cir.ptr<!s32i>
%12 = cir.load align(4) %11 : !cir.ptr<!s32i>, !s32i
cir.store align(4) %12, %3 : !s32i, !cir.ptr<!s32i>
however the %0
is actually the address storing p
but not the p
itself.
Shouldn't the deref
be placed on statement %12
where the dereference actually happens.
Metadata
Metadata
Assignees
Labels
No labels