Hi,


Would a gatekeeper please review the fix for bug 712?

https://bugs.open64.net/show_bug.cgi?id=712



The assertion happens in the code of Process_Formal_ST (ipo_inline.cxx) when
the fixup method for the formal is FM_REPLACE_ACTUAL (i.e., formal replaced
by the actual parameter).

   2813     case FM_REPLACE_ACTUAL:

   2814     if (WN_offset (wn) == 0 && WN_operator (wn) == OPR_LDID) {

   2815         new_wn = WN_Type_Conversion (IPO_Copy_Tree (parm.Actual_Wn
()),

   2816                      WN_rtype (wn));

   2817         iter.Replace (new_wn);

   2818         iter.Skip ();

   2819     }



When formal is a struct (wn is a MMLDID and WN_rtype(wn) is MTYPE_M),
WN_Type_Conversion meets the assertion. The fix is to change the fixup
method of a struct formal to be FM_REPLACE_ST, instead of FM_REPLACE_ACTUAL.



Here is the simplified failing test case:

file1.c

int  ecryptfs_recv_netlink (...)

{

  struct sockaddr_nl nladdr;

  ...

  int rc = recvfrom (nl_ctx->socket_fd, nlh, buf_len, flags, (struct
sockaddr *) &nladdr, &nladdr_len);

 }



file2.c

...

typedef union

{

  struct sockaddr_x25 *__restrict __sockaddr_x25__;

}  __SOCKADDR_ARG __attribute__ ((__transparent_union__));



ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n,

               int __flags, __SOCKADDR_ARG __addr, socklen_t * __restrict
__addr_len)

{

  return __recvfrom_alias (__fd, __buf, __n, __flags, __addr, __addr_len);

}



__addr is a struct formal. It should *not* be using FM_REPLACE_ACTUAL fixup
method.



Thanks,



Min





Index: ipa/main/optimize/ipo_inline.cxx

===================================================================

--- ipa/main/optimize/ipo_inline.cxx    (revision 3471)

+++ ipa/main/optimize/ipo_inline.cxx    (working copy)

@@ -772,6 +772,9 @@

     if (ST_addr_saved (formal) || ST_addr_passed (formal))

        return FALSE;



+    if (TY_kind(ST_type(formal)) == KIND_STRUCT)

+    return FALSE;

+

     ST *st = Get_actual_st_if_passed (actual);



     if (st == NULL) {
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to