Bug 33620 - [4.3 regression] internal compiler error: canonical types differ for identical types const QList<QStringList> and const QList<QStringList>
Summary: [4.3 regression] internal compiler error: canonical types differ for identica...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Jason Merrill
URL:
Keywords:
: 33865 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-10-01 22:13 UTC by bero
Modified: 2008-02-05 13:34 UTC (History)
7 users (show)

See Also:
Host: x86_64-linux-gnu
Target: x86_64-linux-gnu
Build: x86_64-linux-gnu
Known to work: 4.2.0 4.2.1
Known to fail: 4.3.0
Last reconfirmed: 2007-10-19 20:19:49


Attachments
bzip2-ed preprocessed source (78.12 KB, application/x-bzip2)
2007-10-01 22:14 UTC, bero
Details
smaller testcase, thanks to delta (791 bytes, text/plain)
2007-10-19 23:32 UTC, Janis Johnson
Details
Another variant of the bug (717 bytes, text/plain)
2008-02-02 03:21 UTC, Sharad Singhai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bero 2007-10-01 22:13:13 UTC
Compiling the attached preprocessed code with gcc 4.3 svn rev. 128893 (regardless of compiler flags) results in

project.cpp:2826: internal compiler error: canonical types differ for identical types const QList<QStringList> and const QList<QStringList>
Please submit a full bug report,
See <http://gcc.gnu.org/bugs.html> for instructions.


This breaks building Qt 4.x.
Comment 1 bero 2007-10-01 22:14:48 UTC
Created attachment 14282 [details]
bzip2-ed preprocessed source
Comment 2 Janis Johnson 2007-10-19 16:39:10 UTC
The error also occurs on powerpc64-linux with -m64, where a regression hunt identified the following patch:

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

    r128488 | jason | 2007-09-14 06:07:25 +0000 (Fri, 14 Sep 2007)
Comment 3 Janis Johnson 2007-10-19 23:32:06 UTC
Created attachment 14373 [details]
smaller testcase, thanks to delta
Comment 4 Wolfgang Bangerth 2007-10-19 23:54:06 UTC
This is the shortest I can come up with:
----------------------
template <typename T>
struct __attribute__((visibility("default"))) List {};

int bar(List<int> args);
bool test(const List<int> &);

int i = bar(List<int>());

bool test(const List<int> &) {}
---------------------
tmp/bangerth> /tmp/bangerth/bin/gcc-mainline/bin/c++ -c x.cc
x.cc: In function 'bool test(const List<int>&)':
x.cc:9: internal compiler error: canonical types differ for identical types const List<int> and const List<int>
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

W.
Comment 5 Jason Merrill 2007-10-22 18:03:25 UTC
Subject: Bug 33620

Author: jason
Date: Mon Oct 22 18:03:10 2007
New Revision: 129553

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129553
Log:
        PR c++/33620
        * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES.
        * pt.c (apply_late_template_attributes): Splice out dependent
        attributes from DECL_ATTRIBUTES.

        * decl.c (cxx_maybe_build_cleanup): Use build_address.

Added:
    trunk/gcc/testsuite/g++.dg/ext/tmplattr7.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/pt.c

Comment 6 Jason Merrill 2007-10-22 18:04:46 UTC
Fixed.
Comment 7 Martin Michlmayr 2007-10-23 09:36:10 UTC
*** Bug 33865 has been marked as a duplicate of this bug. ***
Comment 8 Sharad Singhai 2008-02-02 03:21:48 UTC
Created attachment 15075 [details]
Another variant of the bug

Another internal compiler error with a similar symptoms.

f.c:11: internal compiler error: canonical types differ for identical types const NGram<I> and const NGram<I>
Comment 9 Sharad Singhai 2008-02-02 03:27:04 UTC
Comment on attachment 15075 [details]
Another variant of the bug

class Header {};

template <int I>
class NGram {
 public:
  Header GetHeader() const;
} __attribute__((__packed__));


template <int I>
Header NGram<I>::GetHeader() const {
  return 0;
}
Comment 10 Wolfgang Bangerth 2008-02-02 04:07:41 UTC
Sharad, what compiler version did you use for the new testcases?
Comment 11 dgregor 2008-02-05 13:34:03 UTC
This latest problem is identical to PR c++/35074, which has now been fixed. The new test case in this bug is passing.