* [Bug c++/52582] g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit)
2012-03-13 18:01 [Bug c++/52582] New: g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit) karsten at redhat dot com
@ 2012-03-13 18:16 ` karsten at redhat dot com
2012-03-13 21:18 ` jakub at gcc dot gnu.org
` (14 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: karsten at redhat dot com @ 2012-03-13 18:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52582
--- Comment #1 from karsten at redhat dot com 2012-03-13 18:01:15 UTC ---
Created attachment 26886
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26886
gzip compressed preprocessed source
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/52582] g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit)
2012-03-13 18:01 [Bug c++/52582] New: g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit) karsten at redhat dot com
2012-03-13 18:16 ` [Bug c++/52582] " karsten at redhat dot com
@ 2012-03-13 21:18 ` jakub at gcc dot gnu.org
2012-03-13 22:17 ` jakub at gcc dot gnu.org
` (13 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-03-13 21:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52582
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-13 21:12:57 UTC ---
Strange, with the 4.7-RH cc1plus I can reproduce the segfault even on
inline void *operator new (__SIZE_TYPE__, void *p) throw ()
{
return p;
}
struct B
{
virtual ~B ();
B ();
};
struct A : B
{
A () : B () {}
virtual void bar ();
};
void
foo ()
{
char a[64];
B *b = new (&a) A ();
b->~B ();
}
(at -O2, both -m32 and -m64), but I can't reproduce it with a cross from
x86_64-linux to powerpc64-linux.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/52582] g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit)
2012-03-13 18:01 [Bug c++/52582] New: g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit) karsten at redhat dot com
2012-03-13 18:16 ` [Bug c++/52582] " karsten at redhat dot com
2012-03-13 21:18 ` jakub at gcc dot gnu.org
@ 2012-03-13 22:17 ` jakub at gcc dot gnu.org
2012-03-13 22:19 ` [Bug c++/52582] [4.7/4.8 Regression] " jakub at gcc dot gnu.org
` (12 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-03-13 22:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52582
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-13 22:15:58 UTC ---
Ah, #define HAVE_AS_GNU_ATTRIBUTE 1 in auto-host.h is essential for this.
This is devirt in action, for some reason the devirtualized A::~A () doesn't
have DECL_EXTERNAL set (not sure what should set it, the FE, the
devirtualizer?)
and likely the rs6000 backend just should be more forgiving and if it can't
find a cgraph node, IMHO call_ABI_of_interest should just return true as a
conservative answer.
So, for 4.7.0 IMHO best would be to do:
--- gcc/config/rs6000/rs6000.c 2012-03-13 19:58:59.342625117 +0100
+++ gcc/config/rs6000/rs6000.c 2012-03-13 23:14:15.693828006 +0100
@@ -7452,6 +7452,9 @@ call_ABI_of_interest (tree fndecl)
/* Interesting functions that we are emitting in this object file. */
c_node = cgraph_get_node (fndecl);
c_node = cgraph_function_or_thunk_node (c_node, NULL);
+ if (c_node == NULL)
+ return true;
+
return !cgraph_only_called_directly_p (c_node);
}
return false;
and for 4.7.1/4.8 (while this can perhaps stay) we should find out why
DECL_EXTERNAL isn't set.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/52582] [4.7/4.8 Regression] g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit)
2012-03-13 18:01 [Bug c++/52582] New: g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit) karsten at redhat dot com
` (2 preceding siblings ...)
2012-03-13 22:17 ` jakub at gcc dot gnu.org
@ 2012-03-13 22:19 ` jakub at gcc dot gnu.org
2012-03-14 10:46 ` rguenth at gcc dot gnu.org
` (11 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-03-13 22:19 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52582
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-03-13
CC| |dje at gcc dot gnu.org,
| |jamborm at gcc dot gnu.org,
| |jason at gcc dot gnu.org
Target Milestone|--- |4.7.0
Summary|g++ ICE when compiling |[4.7/4.8 Regression] g++
|qt-4.8.0 with -O2 on PPC |ICE when compiling qt-4.8.0
|(32bit) |with -O2 on PPC (32bit)
Ever Confirmed|0 |1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/52582] [4.7/4.8 Regression] g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit)
2012-03-13 18:01 [Bug c++/52582] New: g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit) karsten at redhat dot com
` (3 preceding siblings ...)
2012-03-13 22:19 ` [Bug c++/52582] [4.7/4.8 Regression] " jakub at gcc dot gnu.org
@ 2012-03-14 10:46 ` rguenth at gcc dot gnu.org
2012-03-14 13:04 ` rguenth at gcc dot gnu.org
` (10 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-03-14 10:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52582
--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-14 10:41:29 UTC ---
Does
Index: gcc/gimple-fold.c
===================================================================
--- gcc/gimple-fold.c (revision 185376)
+++ gcc/gimple-fold.c (working copy)
@@ -143,6 +143,8 @@ canonicalize_constructor_val (tree cval)
if (cfun && gimple_referenced_vars (cfun))
add_referenced_var (base);
}
+ else if (base && TREE_CODE (base) == FUNCTION_DECL)
+ cgraph_get_create_node (base);
/* Fixup types in global initializers. */
if (TREE_TYPE (TREE_TYPE (cval)) != TREE_TYPE (TREE_OPERAND (cval, 0)))
cval = build_fold_addr_expr (TREE_OPERAND (cval, 0));
@@ -3115,6 +3117,11 @@ gimple_get_virt_method_for_binfo (HOST_W
if (!can_refer_decl_in_current_unit_p (fn))
return NULL_TREE;
+ /* Make sure we create a cgraph node for functions we'll reference.
+ They can be non-existent if the reference comes from an entry
+ of an external vtable for example. */
+ cgraph_get_create_node (fn);
+
return fn;
}
help?
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/52582] [4.7/4.8 Regression] g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit)
2012-03-13 18:01 [Bug c++/52582] New: g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit) karsten at redhat dot com
` (4 preceding siblings ...)
2012-03-14 10:46 ` rguenth at gcc dot gnu.org
@ 2012-03-14 13:04 ` rguenth at gcc dot gnu.org
2012-03-14 14:25 ` jakub at gcc dot gnu.org
` (9 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-03-14 13:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52582
--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-14 13:01:52 UTC ---
Author: rguenth
Date: Wed Mar 14 13:01:46 2012
New Revision: 185381
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185381
Log:
2012-03-14 Richard Guenther <rguenther@suse.de>
PR middle-end/52582
* gimple-fold.c (canonicalize_constructor_val): Make sure
we have a cgraph node for a FUNCTION_DECL that comes from
a constructor.
(gimple_get_virt_method_for_binfo): Likewise.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimple-fold.c
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/52582] [4.7/4.8 Regression] g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit)
2012-03-13 18:01 [Bug c++/52582] New: g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit) karsten at redhat dot com
` (5 preceding siblings ...)
2012-03-14 13:04 ` rguenth at gcc dot gnu.org
@ 2012-03-14 14:25 ` jakub at gcc dot gnu.org
2012-03-14 14:33 ` jakub at gcc dot gnu.org
` (8 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-03-14 14:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52582
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-14 14:21:22 UTC ---
Author: jakub
Date: Wed Mar 14 14:21:12 2012
New Revision: 185383
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185383
Log:
PR c++/52582
* config/rs6000/rs6000.c (call_ABI_of_interest): Return true
if c_node is NULL.
* g++.dg/opt/pr52582.C: New test.
Added:
branches/gcc-4_7-branch/gcc/testsuite/g++.dg/opt/pr52582.C
Modified:
branches/gcc-4_7-branch/gcc/ChangeLog
branches/gcc-4_7-branch/gcc/config/rs6000/rs6000.c
branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/52582] [4.7/4.8 Regression] g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit)
2012-03-13 18:01 [Bug c++/52582] New: g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit) karsten at redhat dot com
` (6 preceding siblings ...)
2012-03-14 14:25 ` jakub at gcc dot gnu.org
@ 2012-03-14 14:33 ` jakub at gcc dot gnu.org
2012-03-14 17:24 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-03-14 14:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52582
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-14 14:24:38 UTC ---
Author: jakub
Date: Wed Mar 14 14:24:32 2012
New Revision: 185384
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185384
Log:
PR c++/52582
* config/rs6000/rs6000.c (call_ABI_of_interest): Return true
if c_node is NULL.
* g++.dg/opt/pr52582.C: New test.
Added:
trunk/gcc/testsuite/g++.dg/opt/pr52582.C
Modified:
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/52582] [4.7/4.8 Regression] g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit)
2012-03-13 18:01 [Bug c++/52582] New: g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit) karsten at redhat dot com
` (7 preceding siblings ...)
2012-03-14 14:33 ` jakub at gcc dot gnu.org
@ 2012-03-14 17:24 ` jakub at gcc dot gnu.org
2012-03-14 18:45 ` jason at gcc dot gnu.org
` (6 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-03-14 17:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52582
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-14 16:12:35 UTC ---
Temporarily worked around for 4.7.0. We really should find out why we aren't
setting DECL_EXTERNAL on this.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/52582] [4.7/4.8 Regression] g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit)
2012-03-13 18:01 [Bug c++/52582] New: g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit) karsten at redhat dot com
` (8 preceding siblings ...)
2012-03-14 17:24 ` jakub at gcc dot gnu.org
@ 2012-03-14 18:45 ` jason at gcc dot gnu.org
2012-03-14 19:27 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2012-03-14 18:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52582
--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> 2012-03-14 18:33:07 UTC ---
Created attachment 26893
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26893
patch
Does this fix it?
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/52582] [4.7/4.8 Regression] g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit)
2012-03-13 18:01 [Bug c++/52582] New: g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit) karsten at redhat dot com
` (9 preceding siblings ...)
2012-03-14 18:45 ` jason at gcc dot gnu.org
@ 2012-03-14 19:27 ` jakub at gcc dot gnu.org
2012-03-15 9:51 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-03-14 19:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52582
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-14 18:44:32 UTC ---
On this testcase? Yes, it does. Haven't done bootstrap/regtest with it
though.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/52582] [4.7/4.8 Regression] g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit)
2012-03-13 18:01 [Bug c++/52582] New: g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit) karsten at redhat dot com
` (10 preceding siblings ...)
2012-03-14 19:27 ` jakub at gcc dot gnu.org
@ 2012-03-15 9:51 ` jakub at gcc dot gnu.org
2012-03-15 22:02 ` jason at gcc dot gnu.org
` (3 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-03-15 9:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52582
--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-15 09:48:31 UTC ---
Bootstrapped/regtested now on x86_64-linux and i686-linux (trunk) and
{x86_64,i686,powerpc,powerpc64}-linux (4.7 branch, with the rs6000.c change
backed out). No regressions. So this looks ok for 4.8/4.7.1 to me, for 4.7.0
I think we should just keep the rs6000 hack. Thanks.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/52582] [4.7/4.8 Regression] g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit)
2012-03-13 18:01 [Bug c++/52582] New: g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit) karsten at redhat dot com
` (11 preceding siblings ...)
2012-03-15 9:51 ` jakub at gcc dot gnu.org
@ 2012-03-15 22:02 ` jason at gcc dot gnu.org
2012-03-22 9:11 ` [Bug c++/52582] [4.7 " rguenth at gcc dot gnu.org
` (2 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2012-03-15 22:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52582
--- Comment #12 from Jason Merrill <jason at gcc dot gnu.org> 2012-03-15 21:22:48 UTC ---
Author: jason
Date: Thu Mar 15 21:22:38 2012
New Revision: 185443
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185443
Log:
PR c++/52582
* method.c (implicitly_declare_fn): Set DECL_EXTERNAL.
Added:
trunk/gcc/testsuite/g++.dg/torture/pr52582.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/method.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/52582] [4.7 Regression] g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit)
2012-03-13 18:01 [Bug c++/52582] New: g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit) karsten at redhat dot com
` (12 preceding siblings ...)
2012-03-15 22:02 ` jason at gcc dot gnu.org
@ 2012-03-22 9:11 ` rguenth at gcc dot gnu.org
2012-03-22 18:47 ` jason at gcc dot gnu.org
2012-03-29 14:14 ` jason at gcc dot gnu.org
15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-03-22 9:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52582
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.7.0 |4.7.1
--- Comment #13 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-22 08:26:39 UTC ---
GCC 4.7.0 is being released, adjusting target milestone.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/52582] [4.7 Regression] g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit)
2012-03-13 18:01 [Bug c++/52582] New: g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit) karsten at redhat dot com
` (13 preceding siblings ...)
2012-03-22 9:11 ` [Bug c++/52582] [4.7 " rguenth at gcc dot gnu.org
@ 2012-03-22 18:47 ` jason at gcc dot gnu.org
2012-03-29 14:14 ` jason at gcc dot gnu.org
15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2012-03-22 18:47 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52582
--- Comment #14 from Jason Merrill <jason at gcc dot gnu.org> 2012-03-22 18:34:30 UTC ---
Author: jason
Date: Thu Mar 22 18:34:24 2012
New Revision: 185705
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185705
Log:
PR c++/52582
* method.c (implicitly_declare_fn): Set DECL_EXTERNAL.
Added:
branches/gcc-4_7-branch/gcc/testsuite/g++.dg/torture/pr52582.C
Modified:
branches/gcc-4_7-branch/gcc/cp/ChangeLog
branches/gcc-4_7-branch/gcc/cp/method.c
branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/52582] [4.7 Regression] g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit)
2012-03-13 18:01 [Bug c++/52582] New: g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit) karsten at redhat dot com
` (14 preceding siblings ...)
2012-03-22 18:47 ` jason at gcc dot gnu.org
@ 2012-03-29 14:14 ` jason at gcc dot gnu.org
15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2012-03-29 14:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52582
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #15 from Jason Merrill <jason at gcc dot gnu.org> 2012-03-29 13:46:28 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 17+ messages in thread