Print this page
Implement -fstrict-calling-conventions
Stock GCC is overly willing to violate the ABI when calling local functions,
such that it passes arguments in registers on i386.  This hampers debugging
with anything other than a fully-aware DWARF debugger, and is generally not
something we desire.
Implement a flag which disables this behaviour, enabled by default.  The flag is
global, though only effective on i386, to more easily allow its globalization
later which, given the odds, is likely to be necessary.

Split Close
Expand all
Collapse all
          --- old/gcc/doc/invoke.texi
          +++ new/gcc/doc/invoke.texi
↓ open down ↓ 6578 lines elided ↑ open up ↑
6579 6579  @smallexample
6580 6580  int f() @{
6581 6581    double d = 3.0;
6582 6582    return ((union a_union *) &d)->i;
6583 6583  @}
6584 6584  @end smallexample
6585 6585  
6586 6586  The @option{-fstrict-aliasing} option is enabled at levels
6587 6587  @option{-O2}, @option{-O3}, @option{-Os}.
6588 6588  
     6589 +@item -fstrict-calling-conventions
     6590 +@opindex mstrict-calling-conventions
     6591 +Use strict ABI calling conventions even with local functions.
     6592 +This disable certain optimizations that may cause GCC to call local
     6593 +functions in a manner other than that described by the ABI.
     6594 +
6589 6595  @item -fstrict-overflow
6590 6596  @opindex fstrict-overflow
6591 6597  Allow the compiler to assume strict signed overflow rules, depending
6592 6598  on the language being compiled.  For C (and C++) this means that
6593 6599  overflow when doing arithmetic with signed numbers is undefined, which
6594 6600  means that the compiler may assume that it will not happen.  This
6595 6601  permits various optimizations.  For example, the compiler will assume
6596 6602  that an expression like @code{i + 10 > i} will always be true for
6597 6603  signed @code{i}.  This assumption is only valid if signed overflow is
6598 6604  undefined, as the expression is false if @code{i + 10} overflows when
↓ open down ↓ 10077 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX