Hi,
I am working on bug 45260 and found that the problem is related to
VIEW_CONVERT_EXPR.
In the prefetching pass, we generate the base address for the prefetching:
tree-ssa-loop-prefetch.c (issue_prefetch_ref):
addr_base = build_fold_addr_expr_with_type (ref->mem, ptr_type_node);
+ gcc_assert (is_gimple_address (addr_base));
Here ref->mem is a COMPONENT_REF and contains a VIEW_CONVERT_EXPR. When I put
an assert after build_fold_addr_expr_with_type, I found that the addr_base is
not a gimple
address at all. The direct reason is that the TREE_OPERAND of the
VIEW_CONVERT_EXPR
is a SSA_NAME.
My questions are:
(1) Can we generate address expression for COMPONENT_REF and contains
VIEW_CONVERT
expression (is it legal to do so)?
(2) The assert in the bug actually occurs in verify_expr in tree-cfg.c, is
this assert valid?
I need to understand whether the bug is in the VIEW_CONVERT_EXPR generation or
in build_fold_addr_expr_with_type.
Thanks for your inputs.
Changpeng