]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/17799 (Non-optimizing compile loses 'this')
authorRichard Henderson <rth@redhat.com>
Sat, 1 Jan 2005 01:43:12 +0000 (17:43 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 1 Jan 2005 01:43:12 +0000 (17:43 -0800)
        PR middle-end/17799
        * function.c (use_register_for_decl): Check DECL_IGNORED_P instead
        of DECL_ARTIFICIAL.
        (assign_parms_augmented_arg_list): Set DECL_IGNORED_P.
        * c-decl.c (build_compound_literal): Likewise.
        * dwarf2asm.c (dw2_force_const_mem): Likewise.
        * gimplify.c (create_artificial_label): Likewise.
        * tree-inline.c (expand_call_inline): Likewise.
        * var-tracking.c (vt_initialize): Likewise.
        * tree-outof-ssa.c (create_temp): Copy DECL_IGNORED_P.
cp/
        * call.c (make_temporary_var_for_ref_to_temp): Set DECL_IGNORED_P.
        * class.c (build_vtable): Don't conditionallize setting it
        based on DWARF2_DEBUG.
        (layout_class_type): Set DECL_IGNORED_P.
        * decl2.c (get_guard): Likewise.
        * rtti.c (get_tinfo_decl, build_lang_decl): Likewise.
        * tree.c (build_local_temp): Likewise.

From-SVN: r92781

15 files changed:
gcc/ChangeLog
gcc/c-decl.c
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/class.c
gcc/cp/decl2.c
gcc/cp/init.c
gcc/cp/rtti.c
gcc/cp/tree.c
gcc/dwarf2asm.c
gcc/function.c
gcc/gimplify.c
gcc/tree-inline.c
gcc/tree-outof-ssa.c
gcc/var-tracking.c

index 57c6b945df3c3a6388b5aea69c304c34adae14e9..ebe2b7d7a296aff6bf31c17cbec58ae0e8d3c79b 100644 (file)
@@ -1,3 +1,16 @@
+2004-12-31  Richard Henderson  <rth@redhat.com>
+
+       PR middle-end/17799
+       * function.c (use_register_for_decl): Check DECL_IGNORED_P instead
+       of DECL_ARTIFICIAL.
+       (assign_parms_augmented_arg_list): Set DECL_IGNORED_P.
+       * c-decl.c (build_compound_literal): Likewise.
+       * dwarf2asm.c (dw2_force_const_mem): Likewise.
+       * gimplify.c (create_artificial_label): Likewise.
+       * tree-inline.c (expand_call_inline): Likewise.
+       * var-tracking.c (vt_initialize): Likewise.
+       * tree-outof-ssa.c (create_temp): Copy DECL_IGNORED_P.
+
 2004-12-31  Andrew Pinski  <pinskia@physics.uc.edu>
 
        PR target/19211
index 975e281b5cf3291c952a6d6b002f90b5bfb89490..2ff015ec7dc15be5605ab8012329a6f9c96a9397 100644 (file)
@@ -3479,6 +3479,7 @@ build_compound_literal (tree type, tree init)
       DECL_DEFER_OUTPUT (decl) = 1;
       DECL_COMDAT (decl) = 1;
       DECL_ARTIFICIAL (decl) = 1;
+      DECL_IGNORED_P (decl) = 1;
       pushdecl (decl);
       rest_of_decl_compilation (decl, 1, 0);
     }
index cad590d6afde630076d1fc8604d4810fd50ef75e..ccc975afa84a502acf2f702f0be571088053c7a5 100644 (file)
@@ -1,3 +1,14 @@
+2004-12-31  Richard Henderson  <rth@redhat.com>
+
+       PR middle-end/17799
+       * call.c (make_temporary_var_for_ref_to_temp): Set DECL_IGNORED_P.
+       * class.c (build_vtable): Don't conditionallize setting it
+       based on DWARF2_DEBUG.
+       (layout_class_type): Set DECL_IGNORED_P.
+       * decl2.c (get_guard): Likewise.
+       * rtti.c (get_tinfo_decl, build_lang_decl): Likewise.
+       * tree.c (build_local_temp): Likewise.
+
 2004-12-30  Mark Mitchell  <mark@codesourcery.com>
 
        * cp-tree.h (cp_declarator): Split "name" field into
index f94526af85cc17587349440f9a48c4eea3bab8c7..831d30b48a5f2e1eecd2092d8dc88d2be6b994c2 100644 (file)
@@ -6373,6 +6373,7 @@ make_temporary_var_for_ref_to_temp (tree decl, tree type)
   /* Create the variable.  */
   var = build_decl (VAR_DECL, NULL_TREE, type);
   DECL_ARTIFICIAL (var) = 1;
+  DECL_IGNORED_P (var) = 1;
   TREE_USED (var) = 1;
 
   /* Register the variable.  */
index c7b0c687db6d6a5029580271bb505c0f38b6b7b2..597ec92e78f88c713f02242840a9aedd6e409c26 100644 (file)
@@ -659,28 +659,27 @@ build_vtable (tree class_type, tree name, tree vtable_type)
   DECL_EXTERNAL (decl) = 1;
   DECL_NOT_REALLY_EXTERN (decl) = 1;
 
-  if (write_symbols == DWARF2_DEBUG)
-    /* Mark the VAR_DECL node representing the vtable itself as a
-       "gratuitous" one, thereby forcing dwarfout.c to ignore it.  It
-       is rather important that such things be ignored because any
-       effort to actually generate DWARF for them will run into
-       trouble when/if we encounter code like:
+  /* Mark the VAR_DECL node representing the vtable itself as a
+     "gratuitous" one, thereby forcing dwarfout.c to ignore it.  It
+     is rather important that such things be ignored because any
+     effort to actually generate DWARF for them will run into
+     trouble when/if we encounter code like:
        
-         #pragma interface
-        struct S { virtual void member (); };
+     #pragma interface
+     struct S { virtual void member (); };
           
-       because the artificial declaration of the vtable itself (as
-       manufactured by the g++ front end) will say that the vtable is
-       a static member of `S' but only *after* the debug output for
-       the definition of `S' has already been output.  This causes
-       grief because the DWARF entry for the definition of the vtable
-       will try to refer back to an earlier *declaration* of the
-       vtable as a static member of `S' and there won't be one.  We
-       might be able to arrange to have the "vtable static member"
-       attached to the member list for `S' before the debug info for
-       `S' get written (which would solve the problem) but that would
-       require more intrusive changes to the g++ front end.  */
-    DECL_IGNORED_P (decl) = 1;
+     because the artificial declaration of the vtable itself (as
+     manufactured by the g++ front end) will say that the vtable is
+     a static member of `S' but only *after* the debug output for
+     the definition of `S' has already been output.  This causes
+     grief because the DWARF entry for the definition of the vtable
+     will try to refer back to an earlier *declaration* of the
+     vtable as a static member of `S' and there won't be one.  We
+     might be able to arrange to have the "vtable static member"
+     attached to the member list for `S' before the debug info for
+     `S' get written (which would solve the problem) but that would
+     require more intrusive changes to the g++ front end.  */
+  DECL_IGNORED_P (decl) = 1;
 
   return decl;
 }
@@ -3529,13 +3528,13 @@ build_base_field (record_layout_info rli, tree binfo,
       /* Create the FIELD_DECL.  */
       decl = build_decl (FIELD_DECL, NULL_TREE, CLASSTYPE_AS_BASE (basetype));
       DECL_ARTIFICIAL (decl) = 1;
+      DECL_IGNORED_P (decl) = 1;
       DECL_FIELD_CONTEXT (decl) = t;
       DECL_SIZE (decl) = CLASSTYPE_SIZE (basetype);
       DECL_SIZE_UNIT (decl) = CLASSTYPE_SIZE_UNIT (basetype);
       DECL_ALIGN (decl) = CLASSTYPE_ALIGN (basetype);
       DECL_USER_ALIGN (decl) = CLASSTYPE_USER_ALIGN (basetype);
       DECL_MODE (decl) = TYPE_MODE (basetype);
-      DECL_IGNORED_P (decl) = 1;
       DECL_FIELD_IS_BASE (decl) = 1;
 
       /* Try to place the field.  It may take more than one try if we
@@ -4697,6 +4696,7 @@ layout_class_type (tree t, tree *virtuals_p)
          DECL_SIZE (padding_field) = padding;
          DECL_CONTEXT (padding_field) = t;
          DECL_ARTIFICIAL (padding_field) = 1;
+         DECL_IGNORED_P (padding_field) = 1;
          layout_nonempty_base_or_field (rli, padding_field,
                                         NULL_TREE, 
                                         empty_base_offsets);
index 0df5b25e1170bad916572f1da997c45ddb925333..9572a267a512db1766ae50a93bb39ee0964ac748 100644 (file)
@@ -1998,6 +1998,7 @@ get_guard (tree decl)
         DECL_WEAK (guard) = DECL_WEAK (decl);
       
       DECL_ARTIFICIAL (guard) = 1;
+      DECL_IGNORED_P (guard) = 1;
       TREE_USED (guard) = 1;
       pushdecl_top_level_and_finish (guard, NULL_TREE);
     }
index 2bff006d591905f0e65cf1f20f890d75bc29f9ef..70a7802e6dd9de0f83d2d39fb0c6acdbff4c153b 100644 (file)
@@ -2341,8 +2341,8 @@ create_temporary_var (tree type)
   decl = build_decl (VAR_DECL, NULL_TREE, type);
   TREE_USED (decl) = 1;
   DECL_ARTIFICIAL (decl) = 1;
-  DECL_SOURCE_LOCATION (decl) = input_location;
   DECL_IGNORED_P (decl) = 1;
+  DECL_SOURCE_LOCATION (decl) = input_location;
   DECL_CONTEXT (decl) = current_function_decl;
 
   return decl;
index 4740533a7b3295f0af651cb75cba196a780dfc07..b683dad4d476397741dd213423840fbef07c3d1b 100644 (file)
@@ -350,6 +350,7 @@ get_tinfo_decl (tree type)
       TREE_TYPE (name) = type;
       DECL_TINFO_P (d) = 1;
       DECL_ARTIFICIAL (d) = 1;
+      DECL_IGNORED_P (d) = 1;
       TREE_READONLY (d) = 1;
       TREE_STATIC (d) = 1;
       /* Mark the variable as undefined -- but remember that we can
@@ -778,6 +779,7 @@ tinfo_base_init (tree desc, tree target)
     name_decl = build_lang_decl (VAR_DECL, name_name, name_type);
     SET_DECL_ASSEMBLER_NAME (name_decl, name_name);
     DECL_ARTIFICIAL (name_decl) = 1;
+    DECL_IGNORED_P (name_decl) = 1;
     TREE_READONLY (name_decl) = 1;
     TREE_STATIC (name_decl) = 1;
     DECL_EXTERNAL (name_decl) = 0;
index 2b6ef71b0faa6d1431e787e4328289994e2ed79a..b9a7a250039182e74b04ded76693751cb2485411 100644 (file)
@@ -241,6 +241,7 @@ build_local_temp (tree type)
 {
   tree slot = build_decl (VAR_DECL, NULL_TREE, type);
   DECL_ARTIFICIAL (slot) = 1;
+  DECL_IGNORED_P (slot) = 1;
   DECL_CONTEXT (slot) = current_function_decl;
   layout_decl (slot, 0);
   return slot;
index c963fbcdd1c379199389c2c64b50e3c6a8d4fdf1..ae8af709ede2af5d4bac5c63f1cb0c5839ab40e1 100644 (file)
@@ -729,6 +729,7 @@ dw2_force_const_mem (rtx x)
          id = get_identifier (ref_name);
          decl = build_decl (VAR_DECL, id, ptr_type_node);
          DECL_ARTIFICIAL (decl) = 1;
+         DECL_IGNORED_P (decl) = 1;
          TREE_PUBLIC (decl) = 1;
          DECL_INITIAL (decl) = decl;
          make_decl_one_only (decl);
@@ -742,6 +743,7 @@ dw2_force_const_mem (rtx x)
          id = get_identifier (label);
          decl = build_decl (VAR_DECL, id, ptr_type_node);
          DECL_ARTIFICIAL (decl) = 1;
+         DECL_IGNORED_P (decl) = 1;
          TREE_STATIC (decl) = 1;
          DECL_INITIAL (decl) = decl;
        }
index eb1e14e5d7e589317c8340440d930a3a5f9d3c35..e878dc13e1d4eb796a551e1ba56c5ab9270f5ad7 100644 (file)
@@ -1922,8 +1922,9 @@ use_register_for_decl (tree decl)
   if (flag_float_store && FLOAT_TYPE_P (TREE_TYPE (decl)))
     return false;
 
-  /* Compiler-generated temporaries can always go in registers.  */
-  if (DECL_ARTIFICIAL (decl))
+  /* If we're not interested in tracking debugging information for
+     this decl, then we can certainly put it in a register.  */
+  if (DECL_IGNORED_P (decl))
     return true;
 
   return (optimize || DECL_REGISTER (decl));
@@ -2105,6 +2106,7 @@ assign_parms_augmented_arg_list (struct assign_parm_data_all *all)
       decl = build_decl (PARM_DECL, NULL_TREE, type);
       DECL_ARG_TYPE (decl) = type;
       DECL_ARTIFICIAL (decl) = 1;
+      DECL_IGNORED_P (decl) = 1;
 
       TREE_CHAIN (decl) = fnargs;
       fnargs = decl;
index ca3759769b133331ef42cefa728e2495df7f7a98..0c8cc95179b34ad0e9d6c08395a146be3daf6f20 100644 (file)
@@ -293,6 +293,7 @@ create_artificial_label (void)
   tree lab = build_decl (LABEL_DECL, NULL_TREE, void_type_node);
 
   DECL_ARTIFICIAL (lab) = 1;
+  DECL_IGNORED_P (lab) = 1;
   DECL_CONTEXT (lab) = current_function_decl;
   return lab;
 }
index 3ba728b7a9120e03f3ca2fd1ab65b179b879948e..8f3e161d292211bf0ce03e076dd52847688414f5 100644 (file)
@@ -1569,6 +1569,7 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data)
      to the RET_LABEL.  */
   id->ret_label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
   DECL_ARTIFICIAL (id->ret_label) = 1;
+  DECL_IGNORED_P (id->ret_label) = 1;
   DECL_CONTEXT (id->ret_label) = VARRAY_TREE (id->fns, 0);
   insert_decl_map (id, id->ret_label, id->ret_label);
 
index ecd23ede219c1ccaf4d5d65a3cd3c545ed576282..7342a20523b252686d5eab9c394ac5978950b46b 100644 (file)
@@ -162,6 +162,7 @@ create_temp (tree t)
   else if (!DECL_IGNORED_P (t))
     DECL_DEBUG_ALIAS_OF (tmp) = t;
   DECL_ARTIFICIAL (tmp) = DECL_ARTIFICIAL (t);
+  DECL_IGNORED_P (tmp) = DECL_IGNORED_P (t);
   add_referenced_tmp_var (tmp);
 
   /* add_referenced_tmp_var will create the annotation and set up some
index ef9f9dcc5d6bf79ca867bf0f93cd75b1afe6d43f..f1f36614509f85f55b3047143514a9391edb8520 100644 (file)
@@ -2705,6 +2705,7 @@ vt_initialize (void)
       DECL_NAME (frame_base_decl) = get_identifier ("___frame_base_decl");
       TREE_TYPE (frame_base_decl) = char_type_node;
       DECL_ARTIFICIAL (frame_base_decl) = 1;
+      DECL_IGNORED_P (frame_base_decl) = 1;
 
       /* Set its initial "location".  */
       frame_stack_adjust = -prologue_stack_adjust ();