This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Java inliner: un-promote retvar
- From: Andrew Haley <aph at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 3 Oct 2002 15:57:04 +0100 (BST)
- Subject: Java inliner: un-promote retvar
In the inliner it's necessary to convert (demote?) a promoted retvar
back to the expected type. The linliner for C does so already, but I
forgot to do it for Java.
Andrew.
2002-10-03 Andrew Haley <aph@redhat.com>
* tree-inline.c (expand_call_inline): Convert retvar to expected
type.
Index: tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.31
diff -p -2 -c -r1.31 tree-inline.c
*** tree-inline.c 27 Sep 2002 12:48:04 -0000 1.31
--- tree-inline.c 3 Oct 2002 14:52:42 -0000
*************** expand_call_inline (tp, walk_subtrees, d
*** 1219,1225 ****
#else /* INLINER_FOR_JAVA */
if (retvar)
! BLOCK_EXPR_BODY (expr)
! = add_stmt_to_compound (BLOCK_EXPR_BODY (expr),
! TREE_TYPE (retvar), retvar);
#endif /* INLINER_FOR_JAVA */
--- 1219,1231 ----
#else /* INLINER_FOR_JAVA */
if (retvar)
! {
! /* Mention the retvar. If the return type of the function was
! promoted, convert it back to the expected type. */
! if (TREE_TYPE (TREE_TYPE (fn)) != TREE_TYPE (retvar))
! retvar = build1 (NOP_EXPR, TREE_TYPE (TREE_TYPE (fn)), retvar);
! BLOCK_EXPR_BODY (expr)
! = add_stmt_to_compound (BLOCK_EXPR_BODY (expr),
! TREE_TYPE (retvar), retvar);
! }
#endif /* INLINER_FOR_JAVA */