compile with gcc option -O0 or -O

zou wonder wonder.zou@gmail.com
Fri Sep 16 09:12:00 GMT 2011


hi david:
i have tried to enable all the warning option you provided :
and here are some warnings:

                from xmmmapte.cc:3:
/work/smsc/include/stlport/stl/_ostream.h:357: warning: inlining
failed in call to ‘stlpmtx_std::basic_ostream<_CharT, _Traits>&
stlpmtx_std::endl(stlpmtx_std::basic_ostream<_CharT, _Traits>&) [with
_CharT = char, _Traits = stlpmtx_std::char_traits<char>]’: call is
unlikely and code size would grow
/work/smsc/include/stlport/stl/_ostream.h:78: warning: called from here
In file included from xmmmapte.cc:3:
/work/smsc/include/stlport/stl/_string.h: In function ‘void
set_map_perror_from_report_cause(VARIABLE_STR*, VTASK*)’:
/work/smsc/include/stlport/stl/_string.h:372: warning: inlining failed
in call to ‘stlpmtx_std::basic_string<_CharT, _Traits,
_Alloc>::~basic_string() [with _CharT = char, _Traits =
stlpmtx_std::char_traits<char>, _Alloc =
stlpmtx_std::allocator<char>]’: call is unlikely and code size would
grow
xmmmap.cc:2166: warning: called from here
/work/smsc/include/stlport/stl/_string.h:372: warning: inlining failed
in call to ‘stlpmtx_std::basic_string<_CharT, _Traits,
_Alloc>::~basic_string() [with _CharT = char, _Traits =
stlpmtx_std::char_traits<char>, _Alloc =
stlpmtx_std::allocator<char>]’: call is unlikely and code size would
grow
xmmmap.cc:2166: warning: called from here
/work/smsc/include/stlport/stl/_string.h:372: warning: inlining failed
in call to ‘stlpmtx_std::basic_string<_CharT, _Traits,
_Alloc>::~basic_string() [with _CharT = char, _Traits =
stlpmtx_std::char_traits<char>, _Alloc =
stlpmtx_std::allocator<char>]’: call is unlikely and code size would
grow
xmmmap.cc:2166: warning: called from here
/work/smsc/include/stlport/stl/_string.h:372: warning: inlining failed
in call to ‘stlpmtx_std::basic_string<_CharT, _Traits,
_Alloc>::~basic_string() [with _CharT = char, _Traits =
stlpmtx_std::char_traits<char>, _Alloc =
stlpmtx_std::allocator<char>]’: call is unlikely and code size would
grow
xmmmap.cc:2166: warning: called from here
/work/smsc/include/stlport/stl/_string.h:372: warning: inlining failed
in call to ‘stlpmtx_std::basic_string<_CharT, _Traits,
_Alloc>::~basic_string() [with _CharT = char, _Traits =
stlpmtx_std::char_traits<char>, _Alloc =
stlpmtx_std::allocator<char>]’: call is unlikely and code size would
grow
xmmmap.cc:2168: warning: called from here
/work/smsc/include/stlport/stl/_string.h:372: warning: inlining failed
in call to ‘stlpmtx_std::basic_string<_CharT, _Traits,
_Alloc>::~basic_string() [with _CharT = char, _Traits =
stlpmtx_std::char_traits<char>, _Alloc =
stlpmtx_std::allocator<char>]’: call is unlikely and code size would
grow
xmmmap.cc:2168: warning: called from here
In file included from /work/smsc/include/stlport/stl/_string_io.h:23,

                 from /work/smsc/include/xmmhdrmx.h:24,
                 from xmmmanmx.cc:21:
/work/smsc/include/xrslimmx.h:213: warning: padding struct to align
‘xrsIpSocketParameters_s::portNumber’
In file included from /work/smsc/include/xsc_common_mx.h:25,
                 from /work/smsc/include/xscalamx.h:31,
                 from /work/smsc/include/xmmhdrmx.h:24,
                 from xmmmanmx.cc:21:
/work/smsc/include/xrsdefmx.h:54: warning: padding struct size to
alignment boundary
/work/smsc/include/xrsdefmx.h:59: warning: padding struct size to
alignment boundary
/work/smsc/include/xrsdefmx.h:89: warning: padding struct to align
‘<anonymous struct>::smUserData’
/work/smsc/include/xrsdefmx.h:93: warning: padding struct to align
‘<anonymous struct>::tariffClass’
/work/smsc/include/xrsdefmx.h:83: warning: padding struct size to
alignment boundary
/work/smsc/include/xrsdefmx.h:106: warning: padding struct to align
‘<anonymous struct>::msgRef’
/work/smsc/include/xrsdefmx.h:114: warning: padding struct to align
‘<anonymous struct>::msgRef’
/work/smsc/include/xrsdefmx.h:116: warning: padding struct to align
‘<anonymous struct>::destIMSIAddr’
/work/smsc/include/xrsdefmx.h:118: warning: padding struct to align
‘<anonymous struct>::smUserData’
/work/smsc/include/xrsdefmx.h:125: warning: padding struct to align
‘<anonymous struct>::msgRef’
/work/smsc/include/xrsdefmx.h:127: warning: padding struct to align
‘<anonymous struct>::smUserData’
/work/smsc/include/xrsdefmx.h:130: warning: padding struct to align
‘<anonymous struct>::origIMSIAddr’
/work/smsc/include/xrsdefmx.h:137: warning: padding struct to align
‘<anonymous struct>::msgRef’
/work/smsc/include/xrsdefmx.h:146: warning: padding struct to align
‘<anonymous struct>::msgRef’
/work/smsc/include/xrsdefmx.h:162: warning: padding struct to align
‘<anonymous struct>::destIMSIAddr’
/work/smsc/include/xrsdefmx.h:164: warning: padding struct to align
‘<anonymous struct>::smUserData’
/work/smsc/include/xrsdefmx.h:172: warning: padding struct to align
‘<anonymous struct>::moSmLimit’
/work/smsc/include/xrsdefmx.h:198: warning: padding struct size to
alignment boundary
/work/smsc/include/xrsdefmx.h:205: warning: padding struct to align
‘<anonymous struct>::imsiAddr’
/work/smsc/include/xrsdefmx.h:203: warning: padding struct size to
alignment boundary
/work/smsc/include/xrsdefmx.h:212: warning: padding struct to align
‘<anonymous struct>::cause’
/work/smsc/include/xrsdefmx.h:225: warning: padding struct size to
alignment boundary
/work/smsc/include/xrsdefmx.h:317: warning: padding struct to align ‘WPrim::req’

thanks
On Fri, Sep 16, 2011 at 2:31 PM, Ian Lance Taylor <iant@google.com> wrote:
> zou wonder <wonder.zou@gmail.com> writes:
>
>> another is what is the difference between -O0 and -O?
>
> Please reply to the mailing list, not just to me.  Thanks.
>
> -O0 means no optimization.  -O, which is the same as -O1, means to
> optimize the code.  This is explained in the manual.
>
>
>> On Fri, Sep 16, 2011 at 2:16 PM, zou wonder <wonder.zou@gmail.com> wrote:
>>> Hi Ian:
>>>
>>>     Acctually, i intercept the codes from our product, and there are
>>> tons of lines.
>>>
>>> so how can i provide that useful information?
>
> I don't know.  What I do know is that we can't help you without seeing
> much more of the program.  The tiny bit of code you showed looked fine.
> The problem was probably somewhere else.
>
> Ian
>
>
>>> On Fri, Sep 16, 2011 at 1:40 PM, Ian Lance Taylor <iant@google.com> wrote:
>>>> zou wonder <wonder.zou@gmail.com> writes:
>>>>
>>>>> but one weird problem is that the following codes compiled with option -O0
>>>>
>>>> You need to show us a small complete self-contained example.
>>>>
>>>> Normally a program which works at -O0 and fails at -O1 has an
>>>> uninitialized variable somewhere.
>>>>
>>>> Ian
>>>>
>>>
>



More information about the Gcc-help mailing list