public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/40975] New: internal compiler error: in copy_tree_r, at tree-inline.c
@ 2009-08-05 18:15 jonathan dot jones at mathworks dot com
2009-08-05 22:42 ` [Bug c++/40975] " mikpe at it dot uu dot se
2009-08-06 9:06 ` rguenth at gcc dot gnu dot org
0 siblings, 2 replies; 6+ messages in thread
From: jonathan dot jones at mathworks dot com @ 2009-08-05 18:15 UTC (permalink / raw)
To: gcc-bugs
Using array new as a default initializer of a constructor argument, when the
object being "newed" itself contains a constructor, crashes the compiler with
an error similar to the following:
% g++ -c gcc_bug.cpp
gcc_bug.cpp:13: internal compiler error: in copy_tree_r, at
tree-inline.c:3160
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.3/README.Bugs> for instructions.
The following code example clearly demonstrates the problem.
// BEGIN gcc_bug.cpp
struct data_type
{
// constructor required to reproduce compiler bug
data_type() {}
};
struct ptr_type
{
// array new as default argument required to reproduce compiler bug
ptr_type (data_type* ptr = new data_type[1]) { delete[] ptr; }
};
ptr_type obj;
// END gcc_bug.cpp
The problem is visible in multiple versions of the compiler on multiple
systems:
% g++ -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.2-1.1'
--with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3
--program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug
--enable-objc-gc --enable-mpfr --enable-cld --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.2 (Debian 4.3.2-1.1)
% g++ -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.2-1.1'
--with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3
--program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug
--enable-objc-gc --enable-mpfr --enable-targets=all --enable-cld
--enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu
--target=i486-linux-gnu
Thread model: posix
gcc version 4.3.2 (Debian 4.3.2-1.1)
% g++ -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --enable-checking=release
x86_64-linux-gnu
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
% g++ -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --with-tune=i686
--enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
Note that the problem is _not_ visible on the following compilers/platforms:
% g++-4.0 -v
Using built-in specs.
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5484~1/src/configure --disable-checking
-enable-werror --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.0/
--with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib
--build=i686-apple-darwin9 --with-arch=apple --with-tune=generic
--host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5484)
g++-4.2 -v
Using built-in specs.
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc_42/gcc_42-5564~1/src/configure --disable-checking
--enable-werror --prefix=/usr --mandir=/usr/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
--with-gxx-include-dir=/usr/include/c++/4.0.0 --with-slibdir=/usr/lib
--build=i686-apple-darwin9 --host=i686-apple-darwin9
--target=i686-apple-darwin9
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5564)
--
Summary: internal compiler error: in copy_tree_r, at tree-
inline.c
Product: gcc
Version: 4.3.2
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jonathan dot jones at mathworks dot com
GCC build triplet: x86_64-linux-gnu, i486-linux-gnu
GCC host triplet: x86_64-linux-gnu, i486-linux-gnu
GCC target triplet: x86_64-linux-gnu, i486-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40975
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/40975] internal compiler error: in copy_tree_r, at tree-inline.c
2009-08-05 18:15 [Bug c++/40975] New: internal compiler error: in copy_tree_r, at tree-inline.c jonathan dot jones at mathworks dot com
@ 2009-08-05 22:42 ` mikpe at it dot uu dot se
2009-08-06 9:06 ` rguenth at gcc dot gnu dot org
1 sibling, 0 replies; 6+ messages in thread
From: mikpe at it dot uu dot se @ 2009-08-05 22:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from mikpe at it dot uu dot se 2009-08-05 22:42 -------
I can reproduce this ICE on i686-linux with gcc-4.3-20090802 and
gcc-4.4-20090804. gcc-4.5 has some nasty new build requirements for c++ so I
didn't try it.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40975
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/40975] internal compiler error: in copy_tree_r, at tree-inline.c
2009-08-05 18:15 [Bug c++/40975] New: internal compiler error: in copy_tree_r, at tree-inline.c jonathan dot jones at mathworks dot com
2009-08-05 22:42 ` [Bug c++/40975] " mikpe at it dot uu dot se
@ 2009-08-06 9:06 ` rguenth at gcc dot gnu dot org
1 sibling, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-08-06 9:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2009-08-06 09:06 -------
Confirmed.
#1 0x00000000007b927a in copy_tree_r (tp=0x7ffff5fcacb0,
walk_subtrees=0x7fffffffb6c0, data=0x0)
at /space/rguenther/src/svn/trunk/gcc/tree-inline.c:3814
3814 gcc_assert (code != STATEMENT_LIST);
#2 0x00000000006d4252 in bot_manip (tp=0x7ffff5fcacb0,
walk_subtrees=0x7fffffffb6c0, data=0x18a5fc0)
at /space/rguenther/src/svn/trunk/gcc/cp/tree.c:1669
#3 0x0000000000dd1432 in walk_tree_1 (tp=0x7ffff5fcacb0,
func=0x6d3b8b <bot_manip>, data=0x18a5fc0, pset=0x0,
lh=0x6db2e2 <cp_walk_subtrees>)
at /space/rguenther/src/svn/trunk/gcc/tree.c:9068
#4 0x0000000000dd3924 in walk_tree_1 (tp=0x7ffff5fcac70,
func=0x6d3b8b <bot_manip>, data=0x18a5fc0, pset=0x0,
lh=0x6db2e2 <cp_walk_subtrees>)
at /space/rguenther/src/svn/trunk/gcc/tree.c:9319
#5 0x0000000000dd3924 in walk_tree_1 (tp=0x7ffff5fcac38,
func=0x6d3b8b <bot_manip>, data=0x18a5fc0, pset=0x0,
lh=0x6db2e2 <cp_walk_subtrees>)
at /space/rguenther/src/svn/trunk/gcc/tree.c:9319
#6 0x00000000006d4324 in break_out_target_exprs (t=0x7ffff5fcabc0)
at /space/rguenther/src/svn/trunk/gcc/cp/tree.c:1709
#7 0x00000000004b261a in convert_default_arg (type=0x7ffff5fc2300,
arg=0x7ffff5fca300, fn=0x7ffff5fc3900, parmnum=0)
at /space/rguenther/src/svn/trunk/gcc/cp/call.c:5233
#8 0x00000000004b4f8e in build_over_call (cand=0x18b3bd0, flags=3, complain=3)
at /space/rguenther/src/svn/trunk/gcc/cp/call.c:5586
#9 0x00000000004ba608 in build_new_method_call (instance=0x7ffff5fb1e60,
fns=0x7ffff5fc5960, args=0x7fffffffd188, conversion_path=0x7ffff5fc7000,
flags=3, fn_p=0x0, complain=3)
at /space/rguenther/src/svn/trunk/gcc/cp/call.c:6320
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |ice-on-valid-code
Last reconfirmed|0000-00-00 00:00:00 |2009-08-06 09:06:04
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40975
^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <bug-40975-4@http.gcc.gnu.org/bugzilla/>]
* [Bug c++/40975] internal compiler error: in copy_tree_r, at tree-inline.c
[not found] <bug-40975-4@http.gcc.gnu.org/bugzilla/>
@ 2011-02-12 10:24 ` Vanuan at gmail dot com
2011-04-19 13:48 ` zsojka at seznam dot cz
2011-04-19 15:09 ` zsojka at seznam dot cz
2 siblings, 0 replies; 6+ messages in thread
From: Vanuan at gmail dot com @ 2011-02-12 10:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40975
Vanuan at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |Vanuan at gmail dot com
--- Comment #3 from Vanuan at gmail dot com 2011-02-12 10:12:34 UTC ---
The same problem using c++0x initializer list:
int some_func(int some_array[] = new int[2]{1,2}) {
}
int main() {
some_func();
}
$ g++ -std=c++0x test.cpp
test.cpp: In function ‘int main()’:
test.cpp:5: internal compiler error: in copy_tree_r, at tree-inline.c:3725
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/40975] internal compiler error: in copy_tree_r, at tree-inline.c
[not found] <bug-40975-4@http.gcc.gnu.org/bugzilla/>
2011-02-12 10:24 ` Vanuan at gmail dot com
@ 2011-04-19 13:48 ` zsojka at seznam dot cz
2011-04-19 15:09 ` zsojka at seznam dot cz
2 siblings, 0 replies; 6+ messages in thread
From: zsojka at seznam dot cz @ 2011-04-19 13:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40975
Zdenek Sojka <zsojka at seznam dot cz> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |zsojka at seznam dot cz
--- Comment #4 from Zdenek Sojka <zsojka at seznam dot cz> 2011-04-19 13:47:53 UTC ---
This is still happening in current trunk (4.7).
Tested revisions:
4.0.4, 4.1.2, 4.2.4, 4.3.5, 4.4.5, 4.5.2, 4.6.0, 4.7.0 - crash
3.3.6, 3.4.6 - OK (without checking)
It might be a regression from 3.4, but I don't have a build with checking
enabled to verify.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/40975] internal compiler error: in copy_tree_r, at tree-inline.c
[not found] <bug-40975-4@http.gcc.gnu.org/bugzilla/>
2011-02-12 10:24 ` Vanuan at gmail dot com
2011-04-19 13:48 ` zsojka at seznam dot cz
@ 2011-04-19 15:09 ` zsojka at seznam dot cz
2 siblings, 0 replies; 6+ messages in thread
From: zsojka at seznam dot cz @ 2011-04-19 15:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40975
--- Comment #5 from Zdenek Sojka <zsojka at seznam dot cz> 2011-04-19 15:08:36 UTC ---
Indeed 3.4 works even with checking enabled:
$ /mnt/sda1/gcc-3_4/binary-172709/bin/g++ pr40975.C -c
$ g++ -v
Reading specs from
/mnt/sda1/gcc-3_4/binary-172709/bin/../lib/gcc/x86_64-unknown-linux-gnu/3.4.6/specs
Configured with: /mnt/sda1/gcc-3_4/configure --enable-checking=yes
--enable-languages=c,c++ --prefix=/mnt/sda1/gcc-3_4/binary-172709/
--disable-werror --disable-bootstrap --disable-multilib
Thread model: posix
gcc version 3.4.6
(I can't edit the "known to work/fail" fields, nor the summary)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-04-19 15:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-05 18:15 [Bug c++/40975] New: internal compiler error: in copy_tree_r, at tree-inline.c jonathan dot jones at mathworks dot com
2009-08-05 22:42 ` [Bug c++/40975] " mikpe at it dot uu dot se
2009-08-06 9:06 ` rguenth at gcc dot gnu dot org
[not found] <bug-40975-4@http.gcc.gnu.org/bugzilla/>
2011-02-12 10:24 ` Vanuan at gmail dot com
2011-04-19 13:48 ` zsojka at seznam dot cz
2011-04-19 15:09 ` zsojka at seznam dot cz
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).