public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/42415] New: Bad assembly generated for constructor call
@ 2009-12-17 20:46 truedfx at gentoo dot org
2009-12-17 20:51 ` [Bug c++/42415] " truedfx at gentoo dot org
` (11 more replies)
0 siblings, 12 replies; 13+ messages in thread
From: truedfx at gentoo dot org @ 2009-12-17 20:46 UTC (permalink / raw)
To: gcc-bugs
test.cc:
class A {
void f();
}
void A::f() {
A::A();
}
g++ -c test.cc
/tmp/cciN3Byt.s: Assembler messages:
/tmp/cciN3Byt.s:18: Warning: missing operand; zero assumed
/tmp/cciN3Byt.s:18: Error: undefined symbol `_ZN1AC1Ev' in operation
/tmp/cciN3Byt.s:18: Error: undefined symbol `INTERNAL' in operation
I have no idea if this is valid, but these error messages are very confusing.
This is GCC 4.5, 20091210 snapshot, plus the patch for PR42251.
g++ -v:
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.0-alpha20091210/g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.0-alpha20091210/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-4.5.0_alpha20091210/work/gcc-4.5-20091210/configure
--prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.0-alpha20091210
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.0-alpha20091210/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.0-alpha20091210
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.0-alpha20091210/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.0-alpha20091210/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.0-alpha20091210/include/g++-v4
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec
--disable-fixed-point --without-ppl --without-cloog --enable-nls
--without-included-gettext --with-system-zlib --disable-checking
--disable-werror --enable-secureplt --enable-multilib --enable-libmudflap
--disable-libssp --enable-libgomp
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.5.0-alpha20091210/python
--enable-java-awt=gtk --enable-languages=c,c++,java --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo
4.5.0_alpha20091210' --enable-checking
Thread model: posix
gcc version 4.5.0-alpha20091210 20091210 (experimental) (Gentoo
4.5.0_alpha20091210)
--
Summary: Bad assembly generated for constructor call
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: truedfx at gentoo dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42415
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/42415] Bad assembly generated for constructor call
2009-12-17 20:46 [Bug c++/42415] New: Bad assembly generated for constructor call truedfx at gentoo dot org
@ 2009-12-17 20:51 ` truedfx at gentoo dot org
2009-12-18 11:20 ` [Bug c++/42415] [4.5 Regression] " paolo dot carlini at oracle dot com
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: truedfx at gentoo dot org @ 2009-12-17 20:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from truedfx at gentoo dot org 2009-12-17 20:51 -------
And here's the generated assembly:
.file "test.cc"
.text
.align 2
.globl _ZN1A1fEv
.type _ZN1A1fEv, @function
_ZN1A1fEv:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
movq %rsp, %rbp
.cfi_offset 6, -16
.cfi_def_cfa_register 6
subq $16, %rsp
movq %rdi, -8(%rbp)
movq -8(%rbp), %rax
movq %rax, %rdi
call _ZN1AC1Ev *INTERNAL*
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size _ZN1A1fEv, .-_ZN1A1fEv
.ident "GCC: (Gentoo 4.5.0_alpha20091210) 4.5.0-alpha20091210 20091210
(experimental)"
.section .note.GNU-stack,"",@progbits
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42415
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/42415] [4.5 Regression] Bad assembly generated for constructor call
2009-12-17 20:46 [Bug c++/42415] New: Bad assembly generated for constructor call truedfx at gentoo dot org
2009-12-17 20:51 ` [Bug c++/42415] " truedfx at gentoo dot org
@ 2009-12-18 11:20 ` paolo dot carlini at oracle dot com
2009-12-18 11:21 ` paolo dot carlini at oracle dot com
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-12-18 11:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from paolo dot carlini at oracle dot com 2009-12-18 11:20 -------
Confirmed with r155343 on x86_64-linux. Seems a serious regression to me.
Note the snippet is missing a semicolon, fixed like this:
class A {
void f();
};
void A::f() {
A::A();
}
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu dot org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-12-18 11:20:30
date| |
Summary|Bad assembly generated for |[4.5 Regression] Bad
|constructor call |assembly generated for
| |constructor call
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42415
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/42415] [4.5 Regression] Bad assembly generated for constructor call
2009-12-17 20:46 [Bug c++/42415] New: Bad assembly generated for constructor call truedfx at gentoo dot org
2009-12-17 20:51 ` [Bug c++/42415] " truedfx at gentoo dot org
2009-12-18 11:20 ` [Bug c++/42415] [4.5 Regression] " paolo dot carlini at oracle dot com
@ 2009-12-18 11:21 ` paolo dot carlini at oracle dot com
2009-12-18 11:48 ` paolo dot carlini at oracle dot com
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-12-18 11:21 UTC (permalink / raw)
To: gcc-bugs
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42415
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/42415] [4.5 Regression] Bad assembly generated for constructor call
2009-12-17 20:46 [Bug c++/42415] New: Bad assembly generated for constructor call truedfx at gentoo dot org
` (2 preceding siblings ...)
2009-12-18 11:21 ` paolo dot carlini at oracle dot com
@ 2009-12-18 11:48 ` paolo dot carlini at oracle dot com
2009-12-18 12:46 ` rguenth at gcc dot gnu dot org
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-12-18 11:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from paolo dot carlini at oracle dot com 2009-12-18 11:48 -------
... but indeed could well be invalid, thus a diagnostic issue only: in practice
some other compilers I have at hand disagree.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42415
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/42415] [4.5 Regression] Bad assembly generated for constructor call
2009-12-17 20:46 [Bug c++/42415] New: Bad assembly generated for constructor call truedfx at gentoo dot org
` (3 preceding siblings ...)
2009-12-18 11:48 ` paolo dot carlini at oracle dot com
@ 2009-12-18 12:46 ` rguenth at gcc dot gnu dot org
2009-12-18 13:10 ` jakub at gcc dot gnu dot org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-12-18 12:46 UTC (permalink / raw)
To: gcc-bugs
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Known to work| |4.4.2
Priority|P2 |P1
Target Milestone|--- |4.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42415
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/42415] [4.5 Regression] Bad assembly generated for constructor call
2009-12-17 20:46 [Bug c++/42415] New: Bad assembly generated for constructor call truedfx at gentoo dot org
` (4 preceding siblings ...)
2009-12-18 12:46 ` rguenth at gcc dot gnu dot org
@ 2009-12-18 13:10 ` jakub at gcc dot gnu dot org
2009-12-18 14:06 ` jason at gcc dot gnu dot org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-12-18 13:10 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jakub at gcc dot gnu dot org 2009-12-18 13:10 -------
Caused by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154403
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42415
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/42415] [4.5 Regression] Bad assembly generated for constructor call
2009-12-17 20:46 [Bug c++/42415] New: Bad assembly generated for constructor call truedfx at gentoo dot org
` (5 preceding siblings ...)
2009-12-18 13:10 ` jakub at gcc dot gnu dot org
@ 2009-12-18 14:06 ` jason at gcc dot gnu dot org
2009-12-18 14:14 ` rguenth at gcc dot gnu dot org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-12-18 14:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from jason at gcc dot gnu dot org 2009-12-18 14:06 -------
The testcase is ill-formed.
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jason at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Keywords|wrong-code |accepts-invalid
Last reconfirmed|2009-12-18 11:20:30 |2009-12-18 14:06:06
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42415
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/42415] [4.5 Regression] Bad assembly generated for constructor call
2009-12-17 20:46 [Bug c++/42415] New: Bad assembly generated for constructor call truedfx at gentoo dot org
` (6 preceding siblings ...)
2009-12-18 14:06 ` jason at gcc dot gnu dot org
@ 2009-12-18 14:14 ` rguenth at gcc dot gnu dot org
2009-12-18 15:21 ` jason at gcc dot gnu dot org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-12-18 14:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from rguenth at gcc dot gnu dot org 2009-12-18 14:14 -------
EDG and GCC 4.4 accept it. Can we do so as well with -fpermissive at least?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42415
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/42415] [4.5 Regression] Bad assembly generated for constructor call
2009-12-17 20:46 [Bug c++/42415] New: Bad assembly generated for constructor call truedfx at gentoo dot org
` (7 preceding siblings ...)
2009-12-18 14:14 ` rguenth at gcc dot gnu dot org
@ 2009-12-18 15:21 ` jason at gcc dot gnu dot org
2009-12-18 16:13 ` jason at gcc dot gnu dot org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-12-18 15:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from jason at gcc dot gnu dot org 2009-12-18 15:20 -------
EDG accepts it in G++ mode, but not by default.
The patch I'm testing accepts it with -fpermissive.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42415
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/42415] [4.5 Regression] Bad assembly generated for constructor call
2009-12-17 20:46 [Bug c++/42415] New: Bad assembly generated for constructor call truedfx at gentoo dot org
` (8 preceding siblings ...)
2009-12-18 15:21 ` jason at gcc dot gnu dot org
@ 2009-12-18 16:13 ` jason at gcc dot gnu dot org
2009-12-18 16:16 ` jason at gcc dot gnu dot org
2009-12-18 20:50 ` jason at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-12-18 16:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from jason at gcc dot gnu dot org 2009-12-18 16:13 -------
Subject: Bug 42415
Author: jason
Date: Fri Dec 18 16:12:50 2009
New Revision: 155347
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155347
Log:
PR c++/42415
* call.c (build_new_method_call): Complain about calling the
constructor directly.
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/tc1/dr147.C
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42415
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/42415] [4.5 Regression] Bad assembly generated for constructor call
2009-12-17 20:46 [Bug c++/42415] New: Bad assembly generated for constructor call truedfx at gentoo dot org
` (9 preceding siblings ...)
2009-12-18 16:13 ` jason at gcc dot gnu dot org
@ 2009-12-18 16:16 ` jason at gcc dot gnu dot org
2009-12-18 20:50 ` jason at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-12-18 16:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from jason at gcc dot gnu dot org 2009-12-18 16:16 -------
Fixed.
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42415
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/42415] [4.5 Regression] Bad assembly generated for constructor call
2009-12-17 20:46 [Bug c++/42415] New: Bad assembly generated for constructor call truedfx at gentoo dot org
` (10 preceding siblings ...)
2009-12-18 16:16 ` jason at gcc dot gnu dot org
@ 2009-12-18 20:50 ` jason at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-12-18 20:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from jason at gcc dot gnu dot org 2009-12-18 20:50 -------
Subject: Bug 42415
Author: jason
Date: Fri Dec 18 20:50:08 2009
New Revision: 155350
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155350
Log:
PR c++/42415
* g++.old-deja/g++.jason/temporary5.C: Adjust.
Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.old-deja/g++.jason/temporary5.C
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42415
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2009-12-18 20:50 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-17 20:46 [Bug c++/42415] New: Bad assembly generated for constructor call truedfx at gentoo dot org
2009-12-17 20:51 ` [Bug c++/42415] " truedfx at gentoo dot org
2009-12-18 11:20 ` [Bug c++/42415] [4.5 Regression] " paolo dot carlini at oracle dot com
2009-12-18 11:21 ` paolo dot carlini at oracle dot com
2009-12-18 11:48 ` paolo dot carlini at oracle dot com
2009-12-18 12:46 ` rguenth at gcc dot gnu dot org
2009-12-18 13:10 ` jakub at gcc dot gnu dot org
2009-12-18 14:06 ` jason at gcc dot gnu dot org
2009-12-18 14:14 ` rguenth at gcc dot gnu dot org
2009-12-18 15:21 ` jason at gcc dot gnu dot org
2009-12-18 16:13 ` jason at gcc dot gnu dot org
2009-12-18 16:16 ` jason at gcc dot gnu dot org
2009-12-18 20:50 ` jason 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).