public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11237] New: Internal Compiler Error (segfault) in convert_from_reference at cvt.c:568
@ 2003-06-18 14:04 ehrhardt at mathematik dot uni-ulm dot de
2003-06-18 14:11 ` [Bug c++/11237] " bangerth at dealii dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: ehrhardt at mathematik dot uni-ulm dot de @ 2003-06-18 14:04 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11237
Summary: Internal Compiler Error (segfault) in
convert_from_reference at cvt.c:568
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: critical
Priority: P2
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: ehrhardt@mathematik.uni-ulm.de
CC: gcc-bugs@gcc.gnu.org,stip@mathematik.uni-ulm.de
The code ICEs all versions of gcc since 2.95 and up to 3.4.
The ICE is in this piece of code in cvt.c where we have type == NULL:
tree
convert_from_reference (val)
tree val;
{
tree type = TREE_TYPE (val);
if (TREE_CODE (type) == OFFSET_TYPE)
type = TREE_TYPE (type);
if (TREE_CODE (type) == REFERENCE_TYPE)
return build_indirect_ref (val, NULL);
return val;
}
Comeau's C++ compiler accepts the code in strict C++ mode.
Here's the code:
-------------------- cut -----------------------------
template <bool V, class T>
struct restrictTo {
typedef T type;
};
template <typename T, typename U>
struct isDifferentType
{
static const bool value = true;
};
template <class D>
class ConstDenseVector { };
class MultiIndex { };
template <class C>
void operator+(ConstDenseVector<long> u, ConstDenseVector<long> v)
{ }
template <typename U, typename V>
typename restrictTo< true || isDifferentType< V, V >::value, void>::type
operator+(U u, V v)
{
operator+<long>(u, u);
}
int
main()
{
ConstDenseVector<long> v;
MultiIndex mi;
v + mi;
}
-------------------- cut -----------------------------
regards Christian
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/11237] Internal Compiler Error (segfault) in convert_from_reference at cvt.c:568
2003-06-18 14:04 [Bug c++/11237] New: Internal Compiler Error (segfault) in convert_from_reference at cvt.c:568 ehrhardt at mathematik dot uni-ulm dot de
@ 2003-06-18 14:11 ` bangerth at dealii dot org
2003-07-01 15:26 ` reichelt at gcc dot gnu dot org
2003-07-15 8:24 ` reichelt at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: bangerth at dealii dot org @ 2003-06-18 14:11 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11237
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-06-18 14:11:05
date| |
------- Additional Comments From bangerth at dealii dot org 2003-06-18 14:11 -------
Confirmed. How wicked, not much one can do to reduce it further ;-)
W.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/11237] Internal Compiler Error (segfault) in convert_from_reference at cvt.c:568
2003-06-18 14:04 [Bug c++/11237] New: Internal Compiler Error (segfault) in convert_from_reference at cvt.c:568 ehrhardt at mathematik dot uni-ulm dot de
2003-06-18 14:11 ` [Bug c++/11237] " bangerth at dealii dot org
@ 2003-07-01 15:26 ` reichelt at gcc dot gnu dot org
2003-07-15 8:24 ` reichelt at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2003-07-01 15:26 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11237
------- Additional Comments From reichelt at gcc dot gnu dot org 2003-07-01 15:26 -------
Here's a slightly shorter testcase that crashes since gcc 2.95.x :-(
===========================================================================
template <int> struct A {};
template <typename> struct B
{
enum {e};
};
template <typename> void foo() { }
template <typename T, typename U> A<B<U>::e + 1> foo(T, U)
{
foo<void>();
}
void bar()
{
foo(0,0);
}
===========================================================================
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/11237] Internal Compiler Error (segfault) in convert_from_reference at cvt.c:568
2003-06-18 14:04 [Bug c++/11237] New: Internal Compiler Error (segfault) in convert_from_reference at cvt.c:568 ehrhardt at mathematik dot uni-ulm dot de
2003-06-18 14:11 ` [Bug c++/11237] " bangerth at dealii dot org
2003-07-01 15:26 ` reichelt at gcc dot gnu dot org
@ 2003-07-15 8:24 ` reichelt at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2003-07-15 8:24 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11237
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From reichelt at gcc dot gnu dot org 2003-07-15 08:24 -------
Fixed on mainline (probably related to PR 10079).
(Testcase in preparation.)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-07-15 8:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-18 14:04 [Bug c++/11237] New: Internal Compiler Error (segfault) in convert_from_reference at cvt.c:568 ehrhardt at mathematik dot uni-ulm dot de
2003-06-18 14:11 ` [Bug c++/11237] " bangerth at dealii dot org
2003-07-01 15:26 ` reichelt at gcc dot gnu dot org
2003-07-15 8:24 ` reichelt at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).