This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
expr.c:expand_expr returns error_mark_node, should return an rtx.
- To: jason at cygnus dot com
- Subject: expr.c:expand_expr returns error_mark_node, should return an rtx.
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Wed, 12 Jul 2000 13:13:57 -0400 (EDT)
- Cc: gcc-patches at gcc dot gnu dot org
Jason,
I believe your recent patch:
> 2000-07-09 Jason Merrill <jason@redhat.com>
> * expr.c (expand_expr): Bail earlier if we get an error_mark_node.
causes this warning:
> ../../egcs-CVS20000711/gcc/expr.c:7108: warning: return from
> incompatible pointer type
This is because expand_expr() is declared to return an rtx, and
error_mark_node is a tree.
Does the following patch make sense?
--Kaveh
2000-07-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* expr.c (expand_expr): Return const0_rtx, not error_mark_node.
diff -rup orig/egcs-CVS20000711/gcc/expr.c egcs-CVS20000711/gcc/expr.c
--- orig/egcs-CVS20000711/gcc/expr.c Mon Jul 10 07:29:04 2000
+++ egcs-CVS20000711/gcc/expr.c Wed Jul 12 11:38:47 2000
@@ -7105,7 +7105,7 @@ expand_expr (exp, target, tmode, modifie
case CONVERT_EXPR:
case REFERENCE_EXPR:
if (TREE_OPERAND (exp, 0) == error_mark_node)
- return error_mark_node;
+ return const0_rtx;
if (TREE_CODE (type) == UNION_TYPE)
{