This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c/938: inline nested functions not compiled correctly when using -O0



>Number:         938
>Category:       c
>Synopsis:       inline nested functions not compiled correctly when using -O0
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 30 06:06:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Stephen R. Thomass
>Release:        2.97
>Organization:
>Environment:
All
>Description:
When the following code is compiled with -O0:

int ggg (void)
{
  int v = 42;

  static inline int fff (int x)
  {
    return x*10;
  }

  return fff (v);
}

the resulting object file contains an undefined reference
to 'fff.0', & will fail to link. Disassembly of the object
file appears to contain no definition of function fff.
The problem only seems to occur with nested inline
functions, and only when -O0 is used. With -O1, the function 
fff is correctly optimized away.

The problem occurs with the latest gcc snapshot as of
Nov 30, on http://www.codesourcery.com/gcc-compile/shtml.
The problem was not present in release 2.95.2.
>How-To-Repeat:
Compile any code with a nested inline function using -O0.
>Fix:
Unknown.
>Release-Note:
>Audit-Trail:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]