This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] PATCH to ocp_convert
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 03 Apr 2003 15:04:47 -0500
- Subject: [tree-ssa] PATCH to ocp_convert
The recent inliner change to convert the (promoted) argument back to the
parm type breaks on some classes because ocp_convert is suspicious of
the idea of applying a NOP to an lvalue. But in this case we're not
interested in an lvalue, so the abort is inappropriate. This patch
restricts the abort to types with copy constructors, which need to be
handled specially.
Tested i686-pc-linux-gnu. Applied to trunk and tree-ssa branch.
2003-04-02 Jason Merrill <jason at redhat dot com>
* cvt.c (ocp_convert): Only abort if we try to convert an object
of TREE_ADDRESSABLE type.
*** cvt.c.~1~ 2003-01-17 20:21:30.000000000 -0500
--- cvt.c 2003-04-02 23:55:44.000000000 -0500
*************** ocp_convert (tree type, tree expr, int c
*** 666,672 ****
TREE_TYPE (e) = TREE_TYPE (TARGET_EXPR_SLOT (e)) = type;
return e;
}
! else if (CLASS_TYPE_P (type))
abort ();
else
return fold (build1 (NOP_EXPR, type, e));
--- 666,673 ----
TREE_TYPE (e) = TREE_TYPE (TARGET_EXPR_SLOT (e)) = type;
return e;
}
! else if (TREE_ADDRESSABLE (type))
! /* We shouldn't be treating objects of ADDRESSABLE type as rvalues. */
abort ();
else
return fold (build1 (NOP_EXPR, type, e));