[Bug c++/14639] [3.5 Regression] [non-unit-at-a-time] Incorrect emission of unused compiler-generated destructor
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Jun 4 01:50:00 GMT 2004
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-04 01:50 -------
This should fix it by making non-unit-at-a-time more like unit-at-a-time also removes one ??? to fix
the rest of the way because now we mark the variables when outputing the asm so there is no need to
do it while analyzing the function. I have not tested or bootstrapped this yet, Robert could you test this
as I have a test to study for/do?
Index: passes.c
===============================================================
====
RCS file: /cvs/gcc/gcc/gcc/passes.c,v
retrieving revision 2.17
diff -u -p -r2.17 passes.c
--- passes.c 30 May 2004 18:32:27 -0000 2.17
+++ passes.c 4 Jun 2004 01:45:17 -0000
@@ -370,7 +370,7 @@ rest_of_decl_compilation (tree decl,
|| (flag_unit_at_a_time && DECL_INITIAL (decl)))
&& !DECL_EXTERNAL (decl))
{
- if (flag_unit_at_a_time && !cgraph_global_info_ready
+ if (!cgraph_global_info_ready
&& TREE_CODE (decl) != FUNCTION_DECL && top_level)
cgraph_varpool_finalize_decl (decl);
else
Index: cgraphunit.c
===============================================================
====
RCS file: /cvs/gcc/gcc/gcc/cgraphunit.c,v
retrieving revision 1.64
diff -u -p -r1.64 cgraphunit.c
--- cgraphunit.c 30 May 2004 18:32:24 -0000 1.64
+++ cgraphunit.c 4 Jun 2004 01:45:17 -0000
@@ -395,11 +395,6 @@ record_call_1 (tree *tp, int *walk_subtr
switch (TREE_CODE (t))
{
case VAR_DECL:
- /* ??? Really, we should mark this decl as *potentially* referenced
- by this function and re-examine whether the decl is actually used
- after rtl has been generated. */
- if (TREE_STATIC (t))
- cgraph_varpool_mark_needed_node (cgraph_varpool_node (t));
break;
case ADDR_EXPR:
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14639
More information about the Gcc-bugs
mailing list