Bug 29202 - [4.3 Regression] ICE with external template and const data in the template
Summary: [4.3 Regression] ICE with external template and const data in the template
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.2.0
: P2 normal
Target Milestone: 4.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2006-09-24 12:54 UTC by Pawel Sikora
Modified: 2011-06-27 11:10 UTC (History)
5 users (show)

See Also:
Host:
Target: *-linux
Build:
Known to work: 3.4.0, 4.4.0
Known to fail: 4.1.2, 4.2.0, 4.3.2
Last reconfirmed: 2008-12-29 06:59:10


Attachments
testcase (135.83 KB, application/octet-stream)
2006-09-24 12:54 UTC, Pawel Sikora
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Sikora 2006-09-24 12:54:01 UTC
$ g++ posix_api.ii -c -gdwarf-2 -g2 -feliminate-dwarf2-dups -finline-functions

internal compiler error: in output_pubnames, at dwarf2out.c:7380
Comment 1 Pawel Sikora 2006-09-24 12:54:52 UTC
Created attachment 12319 [details]
testcase
Comment 2 Andrew Pinski 2006-09-24 17:34:43 UTC
Reducing.
Comment 3 Andrew Pinski 2006-09-25 03:19:34 UTC
reduced testcase:
template <class charT> struct s
{
    charT imp() const;
};
template <class charT> charT s<charT>::imp() const
{
    static const int masks[20] = {0};
}
__extension__ extern template char  s<char>::imp() const;
int regcompA(void)
{
  s<char> t;
  t.imp();
}
Comment 4 Janis Johnson 2007-04-25 18:55:02 UTC
A regression hunt on powerpc-linux using the reduced testcase from comment #3 with "-g2 -feliminate-dwarf2-dups -finline-functions" identified the following patch:

    http://gcc.gnu.org/viewcvs?view=rev&rev=100802

    r100802 | hubicka | 2005-06-09 16:21:36 +0000 (Thu, 09 Jun 2005)

The failure also occurs with current trunk.
Comment 5 Joseph S. Myers 2008-07-04 21:31:31 UTC
Closing 4.1 branch.
Comment 6 Jason Merrill 2008-12-04 14:58:36 UTC
I can't reproduce this with current 4.4 sources.
Comment 7 Richard Biener 2008-12-04 15:17:37 UTC
The reduced testcase still fails on the 4.3 branch.
Comment 8 Andrew Pinski 2008-12-29 06:56:28 UTC
A patch was posted to http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00850.html

Maybe some other cgraph changes in 4.4 fixes the problem.
Comment 9 Andrew Pinski 2008-12-29 06:59:10 UTC
This was most likely fixed for 4.4 by the removal of DECL_INLINE.
Comment 10 Joseph S. Myers 2009-03-31 19:42:58 UTC
Closing 4.2 branch.
Comment 11 Richard Biener 2009-08-04 12:27:56 UTC
GCC 4.3.4 is being released, adjusting target milestone.
Comment 12 Richard Biener 2010-05-22 18:11:14 UTC
GCC 4.3.5 is being released, adjusting target milestone.
Comment 13 Richard Biener 2011-06-27 11:10:24 UTC
Fixed for 4.4.0.