Looks good to me.
Thanks,
Michael
From: Mathew, Pallavi [mailto:pallavi.mat...@amd.com]
Sent: Thursday, June 23, 2011 4:59 PM
To: open64-devel@lists.sourceforge.net
Subject: [Open64-devel] Code review request for bug#726 [IPA]
Hi,
Can a gatekeeper review the patch below that fixes bug# 726?
Index: osprey/ipa/main/optimize/ipo_inline.cxx
===================================================================
--- osprey/ipa/main/optimize/ipo_inline.cxx (revision 3661)
+++ osprey/ipa/main/optimize/ipo_inline.cxx (working copy)
@@ -4643,7 +4643,8 @@
WN_next (call) = NULL;
// Check to see if "call" has a return value.
- if (aux.rp.size () > 0 && WN_opcode (call) != OPC_VCALL) {
+ if (aux.rp.size () > 0 && WN_opcode (call) != OPC_VCALL &&
+ WN_opcode (call) != OPC_VICALL && WN_opcode (call) !=
OPC_VINTRINSIC_CALL) {
// Place the call site in a block.
LWN_Insert_Block_Before(aux.part_inl_leftover_call_site, NULL, call);
WN_Set_Parent(call, aux.part_inl_leftover_call_site, Parent_Map,
Current_Map_Tab);
Index: osprey/ipa/main/optimize/ipo_inline_util.h
===================================================================
--- osprey/ipa/main/optimize/ipo_inline_util.h (revision 3661)
+++ osprey/ipa/main/optimize/ipo_inline_util.h (working copy)
@@ -126,7 +126,7 @@
public:
- RETURN_PREG () : use_return_val (FALSE) {
+ RETURN_PREG () : use_return_val (TRUE) {
_u.old_style.num_pregs = 0;
}
Testcase
#include <stdio.h>
typedef void (*inlinedFuncPtr)(char *, int, ...);
void
inlined_subr(char *str, int i, ...)
{
int idx;
if( i == 0 )
return;
printf( "%s=%d\n", str, i);
}
void
inliner_subr( inlinedFuncPtr fcn)
{
(*fcn)("i", 3);
}
int
main()
{
inliner_subr(inlined_subr);
return 1;
}
Problem/Fix Description:
Open64 bug #726.
When above testcase is compiled with 'opencc -Ofast',
ipa_link segfaults or produces the internal error:
Invalid argument for ST_type()
The problem occurs when IPA tries to inline a function pointer that:
- has varargs,
- is determined to be partially inlinable (see
Identify_Partial_Inline_Candiate()
and Has_Partial_Inline_Attrib()), and
- has a void return type.
The assert failure occurs in function ST_Type when called from
ipo_inline.cxx:IPO_INLINE::Post_Process_Caller because it is not recognized
that the callee has a void return type.
Note that a fix for this problem was introduced at revision 3480.
This fix backs out the previous change for bug #726 and implements a new fix
for
the original problem affecting partial inlining of a smaller set of functions
(only those
that have void return type). The new fix, in routine
IPO_INLINE::Post_Process_Caller,
is to add checks for the opcodes OPR_VICALL (void return indirect call) and
OPR_VINTRINSIC_CALL (void return intrinsic call) to the existing check for
OPR_VCALL.
Thanks.
Pallavi
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense..
http://p.sf.net/sfu/splunk-d2d-c1
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel