From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20806 invoked by alias); 7 Oct 2004 22:38:40 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 20788 invoked by uid 48); 7 Oct 2004 22:38:39 -0000 Date: Thu, 07 Oct 2004 22:38:00 -0000 Message-ID: <20041007223839.20787.qmail@sourceware.org> From: "reichelt at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040715181628.16572.wirawan0@softhome.net> References: <20040715181628.16572.wirawan0@softhome.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/16572] [3.4 regression] Wrong filename/line number were reported by g++ in inlining's warning messages X-Bugzilla-Reason: CC X-SW-Source: 2004-10/txt/msg00992.txt.bz2 List-Id: ------- Additional Comments From reichelt at gcc dot gnu dot org 2004-10-07 22:38 ------- Confirmed. Here's a reduced testcase: =========================================== inline void foo(); struct A { static void bar() { foo(); } }; void baz() { A::bar(); } =========================================== With 3.4.2 I get the following bogus error messgage: PR16572.cc: In function `void baz()': PR16572.cc:1: warning: inlining failed in call to 'void foo()': function body not available PR16572.cc:5: warning: called from here In file included from PR16572.cc:10: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PR16572.cc:1: warning: inlining failed in call to 'void foo()': function body not available PR16572.cc:5: warning: called from here PR16572.cc: At global scope: PR16572.cc:1: warning: inline function `void foo()' used but never defined Hey, I didn't include anything! The bogus line numbers in the original testcase just seem to be another symptom of the same problem. In addition the warning is emitted twice. The problem was fixed on mainline by Jan's patch http://gcc.gnu.org/ml/gcc-patches/2004-02/msg00411.html http://gcc.gnu.org/ml/gcc-cvs/2004-03/msg01308.html Quote from the explanation of the patch: ! Inlining is currently performced twice - once in optimize_function in ! C++ frontend, later in cgraph_optimize_function in the backend. This ! kills the first. It is needed for my cgraph code changes where inlining ! must happent after original body has been saved. I think this explains why we get the warning twice. The problem is a regression from the 3.3 branch. Jan, Mark, do you think this can be backported to the 3.4 branch? -- What |Removed |Added ---------------------------------------------------------------------------- CC| |mark at codesourcery dot | |com, hubicka at gcc dot gnu | |dot org, reichelt at gcc dot | |gnu dot org Severity|minor |normal Status|UNCONFIRMED |NEW Ever Confirmed| |1 Keywords| |diagnostic Known to fail| |3.4.0 3.4.2 Known to work| |3.3.5 4.0.0 Last reconfirmed|0000-00-00 00:00:00 |2004-10-07 22:38:36 date| | Summary|Wrong filename/line number |[3.4 regression] Wrong |were reported by g++ in |filename/line number were |inlining's warning messages |reported by g++ in | |inlining's warning messages Target Milestone|--- |3.4.3 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16572