This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Could we use VIEW_CONVERT_EXPR to build ADDR_EXPR ?
- From: "Fang, Changpeng" <Changpeng dot Fang at amd dot com>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Cc: "rguenther at suse dot de" <rguenther at suse dot de>, Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- Date: Thu, 19 Aug 2010 18:55:26 -0500
- Subject: Could we use VIEW_CONVERT_EXPR to build ADDR_EXPR ?
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