We ran into a bug in lower_return_val handling of a MMILOAD. The code is
lowered to do multiple loads of kid0, and it currently uses kid0 directly for
the first value, and then copies of it for the next value; but if the
lower_expr that happens for each iteration deletes the original node, then the
next copy of the original node will fail. Solution is to make all iterations
use a copy. My sources are not in sync with the trunk, so these line numbers
don't match exactly, but I wanted to report the fix in case others want to pick
it up; the fix is in lower_return_val handling of MMILOAD and MLOAD:
==== //sw/compiler/gpgpu/open64/src/be/com/wn_lower.cxx#44 - c:\sw\compiler\gpgp
u\open64\src\be\com\wn_lower.cxx ====
***************
*** 11250,11258 ****
mtype = RETURN_INFO_mtype(return_info, i);
ty_idx_used = Be_Type_Tbl(mtype);
Set_TY_align(ty_idx_used, algn);
! if (i == 0)
! n_rhs = WN_kid0(o_rhs);
! else n_rhs = WN_COPY_Tree(WN_kid0(o_rhs));
// use Mtype_comparison in case ret mtype is 1 or 2 bytes
n_rhs = WN_CreateIload(OPR_ILOAD, Mtype_comparison(mtype), mtype,
WN_load_offset(o_rhs)
--- 11250,11258 ----
mtype = RETURN_INFO_mtype(return_info, i);
ty_idx_used = Be_Type_Tbl(mtype);
Set_TY_align(ty_idx_used, algn);
! // lower_expr may delete original n_rhs, so make sure it is copy,
! // else will lose original o_rhs.
! n_rhs = WN_COPY_Tree(WN_kid0(o_rhs));
// use Mtype_comparison in case ret mtype is 1 or 2 bytes
n_rhs = WN_CreateIload(OPR_ILOAD, Mtype_comparison(mtype), mtype,
WN_load_offset(o_rhs)
***************
*** 11276,11284 ****
mtype = RETURN_INFO_mtype(return_info, i);
ty_idx_used = Be_Type_Tbl(mtype);
Set_TY_align(ty_idx_used, algn);
! if (i == 0)
! n_rhs = WN_kid0(o_rhs);
! else n_rhs = WN_COPY_Tree(WN_kid0(o_rhs));
n_rhs = WN_CreateIload(OPR_ILOAD, mtype, mtype,
WN_load_offset(o_rhs)
+ i * MTYPE_byte_size(mtype),
--- 11276,11284 ----
mtype = RETURN_INFO_mtype(return_info, i);
ty_idx_used = Be_Type_Tbl(mtype);
Set_TY_align(ty_idx_used, algn);
! // lower_expr may delete original n_rhs, so make sure it is copy,
! // else will lose original o_rhs.
! n_rhs = WN_COPY_Tree(WN_kid0(o_rhs));
n_rhs = WN_CreateIload(OPR_ILOAD, mtype, mtype,
WN_load_offset(o_rhs)
+ i * MTYPE_byte_size(mtype),
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may
contain
confidential information. Any unauthorized review, use, disclosure or
distribution
is prohibited. If you are not the intended recipient, please contact the
sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Open64-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/open64-devel