Curious. I suspect you may have an outlier somewhere that hasn't included <strings.h>. You can test that theory by compiling your C code with the CHECKOUT or LANG(STDC99) compiler options and checking the output.

On 7/07/2015 3:58 PM, Jantje. wrote:
Dear Listers,

I am looking to optimizing as much as possible a number of C DLLs. So, I started out 
by #including the <string.h> in order to make sure the compiler will generate 
the builtin version of the string manipulation functions (strcpy, strncpy, strcmp). 
Then I set the OPT(3), ARCH(9), TUNE(9), HOT, INLINE(AUTO,REPORT,250,1500) and 
LIBANSI parameters. So far so good. Macro expansion shows indeed the __strncpy 
builtin substitute being used.

Now, as I have several compilation units, I want to optimize even further by 
using IPA. Indeed, there are function calls across the different compilation 
units that could benefit from inlining. So I add 
IPA(NOOBJECT,ATTR,LEVEL(2),NOUPCASE,MAP,CONTROL) to my options and bring in the 
extra IPA LINK step. The inlining report does indeed show that several function 
calls indeed get inlined, just as I was expecting.

However, something worrying shows up in the output of the prelinker:
WARNING EDC4015: Unresolved references are detected:
CEESTART @@TRGLOC @@GETFN  @@TRGLOR strncpy

The CEESTART, @@TRGLOC, @@GETFN and  @@TRGLOR I was expecting -- I am seeing those 
all the time -- and they get resolved by the automatic library call options of the 
link step that follows. What I am not expecting at all is to see strncpy appear. This 
would mean there is a call to this function that is not being replaced by its builtin 
version. Now I checked and double-checked: the #include <string.h> is there in 
all the compilation units involved. What am I not seeing?

Thanks and very best regards,

Jantje.


P.S. This is z/OS 2.1.
The options of the compile step:

5650ZOS V2.1 z/OS XL C                           'JMO2659.FRM800.C(THADDR)'     
               07/06/2015 16:36:11   Page     1


                                       * * * * *   P R O L O G   * * * * *

  Compile Time Library . . . . . . : 42010000
  Command options:
     Program name. . . . . . . . . : 'JMO2659.FRM800.C(THADDR)'
     Compiler options. . . . . . . : *NOGONUMBER *NOALIAS    *RENT       
*TERMINAL   *NOUPCONV   *SOURCE     *NOLIST
                                   : *NOXREF     *NOAGG      *NOPPONLY   
*NOEXPMAC   *NOSHOWINC  *NOOFFSET   *MEMORY     *SSCOMM
                                   : *NOSHOWMACROS           *SKIPSRC(SHOW)     
     *NOREPORT   *NOMAKEDEP  *PREFETCH   *NOTHREADED
                                   : *LONGNAME   *START      *EXECOPS    
*ARGPARSE   *EXPORTALL  *DLL(NOCALLBACKANY)
                                   : *LIBANSI    *NOWSIZEOF  *REDIR      
*ANSIALIAS  *NODIGRAPH  *NOROCONST  *NOROSTRING
                                   : *TUNE(9)    *ARCH(9)    *SPILL(128) 
*MAXMEM(2097152)        *NOCOMPACT
                                   : *TARGET(LE,CURRENT)     *FLAG(I)    
*NOTEST(NOSYM,NOBLOCK,NOLINE,NOPATH,NOHOOK)     *OPTIMIZE(3)
                                   : *INLINE(AUTO,REPORT,250,1500)       
*NESTINC(255)           *BITFIELD(UNSIGNED)
                                   : *NOINFO
                                   : *NODFP
                                   : *FLOAT(HEX,FOLD,MAF,AFP(NOVOLATILE))
                                   : *NOSTRICT
                                   : *NOCOMPRESS *NOSTRICT_INDUCTION     
*AGGRCOPY(NOOVERLAP)    *CHARS(UNSIGNED)
                                   : *NOIGNERRNO
                                   : *NOINITAUTO
                                   : *NOCSECT
                                   : *NOEVENTS
                                   : *ASSERT(RESTRICT)
                                   : *NORESTRICT
                                   : *OBJECT
                                   : *NOGENASM
                                   : *OPTFILE(DD:OPTS)
                                   : *NOSERVICE
                                   : *NOOE
                                   : 
*IPA(NOLINK,NOOBJECT,COMPRESS,OPTIMIZE,NOLIST,NOGONUMBER,ATTRIBUTE,NOXREF,NOPDF1,NOPDF2)
                                   : *SEARCH(//'CEE.SCEEH.+')
                                   : *NOLSEARCH
                                   : *NOLOCALE   *HALT(16)   *PLIST(HOST)
                                   : *NOCONVLIT
                                   : *NOASCII
                                   : *NOGOFF     *ILP32      *NOWARN64   
*NOHGPR     *HOT        *NOMETAL    *NOARMODE
                                   : 
*NOXPLINK(NOBACKCHAIN,NOSTOREARGS,NOCALLBACK,GUARD,OSCALL(NOSTACK))
                                   : *ENUMSIZE(SMALL)
                                   : *NOHALTONMSG
                                   : *NOSUPPRESS
                                   : *NORTCHECK
                                   : *NODEBUG
                                   : *NOSQL
                                   : *NOCICS
                                   : *UNROLL(AUTO)
                                   : *KEYWORD()
                                   : *NOKEYWORD(typeof)
                                   : *NOSEVERITY
                                   : *NODSAUSER
                                   : *NOINCLUDE
                                   : *NOSMP
                                   : *SYSSTATE(NOASCENV,OSREL(NONE))
                                   : *NOFUNCEVENT
                                   : DEFINE(NS_MVS=1)
                                   : DEFINE(NOT_AGF=1)
     Version Macros. . . . . . . . : __COMPILER_VER__=0x42010000 
__LIBREL__=0x42010000 __TARGET_LIB__=0x42010000
     Language level. . . . . . . . : *EXTENDED:NOTEXTAFTERENDIF
5650ZOS V2.1 z/OS XL C                           'JMO2659.FRM800.C(THADDR)'     
               07/06/2015 16:36:11   Page     2


                                       * * * * *   P R O L O G   * * * * *

     Source margins. . . . . . . . :
       Varying length. . . . . . . : 1 - 80
       Fixed length. . . . . . . . : 1 - 80
     Sequence columns. . . . . . . :
       Varying length. . . . . . . : none
       Fixed length. . . . . . . . : none

                                * * * * *   E N D   O F   P R O L O G   * * * * 
*


The options of the IPA LINK step:

5650-ZOS V2.1 z/OS XL C/C++ IPA                                    DD:SYSIN     
               07/07/2015 09:25:23   Page     1

                                      * * * * *   P R O L O G   * * * * *

  Compile Time Library . . . . . . : 42010000
  Command options:
     Primary input name. . . . . . : DD:SYSIN
     Compiler options. . . . . . . : 
*IPA(LINK,MAP,LEVEL(2),DUP,ER,NONCAL,NOUPCASE,NOPDF1,NOPDF2,NOPDFNAME,CONTROL(//DD:IPACNTL))
                                   : *NOGONUMBER  *HOT         *NOALIAS     
*TERMINAL    *NOLIST      *NOXREF      *NOATTR
                                   : *NOOFFSET    *MEMORY      *NOCSECT     
*NODFP       *NOSTRICT    *LIBANSI     *TUNE(9)
                                   : *ARCH(9)     *FLAG(I)     
*NOTEST(NOSYM,NOBLOCK,NOLINE,NOPATH,NOHOOK)         *OPTIMIZE(3)
                                   : *INLINE(AUTO,REPORT,250,1500)          
*OPTFILE(DD:OPTS)         *NOSERVICE   *NOOE
                                   : *NOLOCALE    *HALT(16)    *NOGOFF      
*NOSPLITLIST

                               * * * * *   E N D   O F   P R O L O G   * * * * *

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to