Bug 10888 - [3.3/3.4 regression] inlining failure for allocate in ~vector()
Summary: [3.3/3.4 regression] inlining failure for allocate in ~vector()
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.3
: P3 normal
Target Milestone: 3.3.1
Assignee: Mark Mitchell
URL:
Keywords: diagnostic
: 10816 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-05-20 21:45 UTC by 193049
Modified: 2004-01-17 04:22 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description 193049 2003-05-20 21:45:59 UTC
 [ Reported to the Debian BTS as report #193049.
   Please CC 193049@bugs.debian.org on replies.
   Log of report can be found at http://bugs.debian.org/193049 ]
	

This program generates warnings with 3.3 and CVS 20030501 whereas it
did not with g++ 3.2:

// Compile with: g++-3.3 -O -Winline essai.cpp

#include <vector>

using namespace std;

int main(void)
{
  vector<int> v(10);

}

$ g++-3.3 -O -Winline essai.cpp
essai.cpp: In member function `std::allocator<_Alloc>::~allocator() [with _Tp =
   int]':
essai.cpp:232:   instantiated from `static _Tp* std::__simple_alloc<_Tp, _Alloc>::allocate(unsigned int) [with _Tp = int, _Alloc = std::__default_alloc_template<true, 0>]'
essai.cpp:233:   instantiated from `_Tp* std::_Vector_alloc_base<_Tp, _Allocator, true>::_M_allocate(unsigned int) [with _Tp = int, _Allocator = std::allocator<int>]'
essai.cpp:127:   instantiated from `std::_Vector_base<_Tp, _Alloc>::_Vector_base(unsigned int, typename std::_Vector_alloc_base<_Tp, _Alloc, std::_Alloc_traits<_Tp, _Allocator>::_S_instanceless>::allocator_type&) [with _Tp = int, _Alloc = std::allocator<int>]'
essai.cpp:158:   instantiated from `std::vector<_Tp, _Alloc>::vector(unsigned int) [with _Tp = int, _Alloc = std::allocator<int>]'
essai.cpp:253:   instantiated from here
/usr/include/c++/3.3/bits/stl_alloc.h:388: warning: inlining failed in call to
   `static void* std::__default_alloc_template<__threads,
   __inst>::allocate(unsigned int) [with bool __threads = true, int __inst = 0]
   '
essai.cpp:232: warning: called from here
essai.cpp: In member function `std::_Vector_base<_Tp, _Alloc>::~_Vector_base()
   [with _Tp = int, _Alloc = std::allocator<int>]':
essai.cpp:242:   instantiated from `static void std::__simple_alloc<_Tp, _Alloc>::deallocate(_Tp*, unsigned int) [with _Tp = int, _Alloc = std::__default_alloc_template<true, 0>]'
essai.cpp:242:   instantiated from `void std::_Vector_alloc_base<_Tp, _Allocator, true>::_M_deallocate(_Tp*, unsigned int) [with _Tp = int, _Allocator = std::allocator<int>]'
essai.cpp:130:   instantiated from `std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = int, _Alloc = std::allocator<int>]'
essai.cpp:253:   instantiated from `std::vector<_Tp, _Alloc>::vector(unsigned int) [with _Tp = int, _Alloc = std::allocator<int>]'
essai.cpp:253:   instantiated from here
/usr/include/c++/3.3/bits/stl_alloc.h:429: warning: inlining failed in call to
   `static void std::__default_alloc_template<__threads,
   __inst>::deallocate(void*, unsigned int) [with bool __threads = true, int
   __inst = 0]'
essai.cpp:242: warning: called from here
essai.cpp: In member function `std::vector<_Tp, _Alloc>::~vector() [with _Tp =
   int, _Alloc = std::allocator<int>]':
essai.cpp:242:   instantiated from `static void std::__simple_alloc<_Tp, _Alloc>::deallocate(_Tp*, unsigned int) [with _Tp = int, _Alloc = std::__default_alloc_template<true, 0>]'
essai.cpp:242:   instantiated from `void std::_Vector_alloc_base<_Tp, _Allocator, true>::_M_deallocate(_Tp*, unsigned int) [with _Tp = int, _Allocator = std::allocator<int>]'
essai.cpp:130:   instantiated from `std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = int, _Alloc = std::allocator<int>]'
essai.cpp:162:   instantiated from `std::vector<_Tp, _Alloc>::~vector() [with _Tp = int, _Alloc = std::allocator<int>]'
essai.cpp:7:   instantiated from here
/usr/include/c++/3.3/bits/stl_alloc.h:429: warning: inlining failed in call to
   `static void std::__default_alloc_template<__threads,
   __inst>::deallocate(void*, unsigned int) [with bool __threads = true, int
   __inst = 0]'
essai.cpp:242: warning: called from here

Release:
3.3 (Debian) (Debian testing/unstable)

Environment:
System: Debian GNU/Linux (unstable)
Architecture: i686
Comment 1 Wolfgang Bangerth 2003-05-20 21:59:17 UTC
Responsible-Changed-From-To: unassigned->gdr
Responsible-Changed-Why: Gaby, do you handle cases like this as well?
Comment 2 Wolfgang Bangerth 2003-05-20 21:59:17 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed. Rather annoying regression, since it makes
    -Winline useless (not that I ever understood its use
    fully, but if one wants to use it one certainly doesn't
    want to get messages from the standard libs).
    
    W.
Comment 3 Wolfgang Bangerth 2003-05-20 22:29:59 UTC
Responsible-Changed-From-To: gdr->unassigned
Responsible-Changed-Why: .
    
    There was more discussion about this in this thread (which
    didn't make it into the audit trail):
      http://gcc.gnu.org/ml/gcc-bugs/2003-05/msg01740.html
Comment 4 GCC Commits 2003-06-20 19:30:41 UTC
Subject: Bug 10888

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	mmitchel@gcc.gnu.org	2003-06-20 19:27:44

Modified files:
	gcc            : ChangeLog tree-inline.c 
	gcc/doc        : invoke.texi 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/warn: Winline-2.C 

Log message:
	PR c++/10888
	* tree-inline.c (expand_call_inline): Do not warn about failing to
	inline functions declared in system headers.
	* doc/invoke.texi (-Winline): Expand on documentation.
	
	PR c++/10888
	* g++.dg/warn/Winline-2.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.598&r2=1.16114.2.599
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-inline.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.38.2.9&r2=1.38.2.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/invoke.texi.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.209.2.30&r2=1.209.2.31
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.195&r2=1.2261.2.196
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/Winline-2.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.4.1

Comment 5 GCC Commits 2003-06-20 19:55:34 UTC
Subject: Bug 10888

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2003-06-20 19:55:29

Modified files:
	gcc            : ChangeLog tree-inline.c 
	gcc/doc        : invoke.texi 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/warn: Winline-3.C 

Log message:
	PR c++/10888
	* tree-inline.c (expand_call_inline): Do not warn about failing to
	inline functions declared in system headers.
	* doc/invoke.texi (-Winline): Expand on documentation.
	
	PR c++/10888
	* g++.dg/warn/Winline-3.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.93&r2=2.94
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-inline.c.diff?cvsroot=gcc&r1=1.62&r2=1.63
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/invoke.texi.diff?cvsroot=gcc&r1=1.294&r2=1.295
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2788&r2=1.2789
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/Winline-3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 6 Mark Mitchell 2003-06-20 19:56:15 UTC
Fixed in GCC 3.3.1, GCC 3.4.
Comment 7 Andrew Pinski 2003-08-05 04:36:56 UTC
*** Bug 10816 has been marked as a duplicate of this bug. ***