OSDN Git Service

2010-03-15 Martin Jambor <mjambor@suse.cz>
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Mar 2010 11:43:04 +0000 (11:43 +0000)
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Mar 2010 11:43:04 +0000 (11:43 +0000)
PR tree/optimization/43141
* tree-sra.c (create_abstract_origin): New function.
(modify_function): Call create_abstract_origin.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157456 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-sra.c

index 437c606..fcb5452 100644 (file)
@@ -1,3 +1,9 @@
+2010-03-15  Martin Jambor  <mjambor@suse.cz>
+
+       PR tree/optimization/43141
+       * tree-sra.c (create_abstract_origin): New function.
+       (modify_function): Call create_abstract_origin.
+
 2010-03-15  Chris Demetriou  <cgd@google.com>
 
        * Makefile.in (stmp-int-hdrs): Don't chmod include/stdint.h if it
index d32ef38..984260f 100644 (file)
@@ -4048,6 +4048,26 @@ convert_callers (struct cgraph_node *node, ipa_parm_adjustment_vec adjustments)
   return;
 }
 
+/* Create an abstract origin declaration for OLD_DECL and make it an abstract
+   origin of the provided decl so that there are preserved parameters for debug
+   information.  */
+
+static void
+create_abstract_origin (tree old_decl)
+{
+  if (!DECL_ABSTRACT_ORIGIN (old_decl))
+    {
+      tree new_decl = copy_node (old_decl);
+
+      DECL_ABSTRACT (new_decl) = 1;
+      SET_DECL_ASSEMBLER_NAME (new_decl, NULL_TREE);
+      SET_DECL_RTL (new_decl, NULL);
+      DECL_STRUCT_FUNCTION (new_decl) = NULL;
+      DECL_ARTIFICIAL (old_decl) = 1;
+      DECL_ABSTRACT_ORIGIN (old_decl) = new_decl;
+    }
+}
+
 /* Perform all the modification required in IPA-SRA for NODE to have parameters
    as given in ADJUSTMENTS.  */
 
@@ -4059,6 +4079,7 @@ modify_function (struct cgraph_node *node, ipa_parm_adjustment_vec adjustments)
     ipa_modify_formal_parameters (alias->decl, adjustments, "ISRA");
   /* current_function_decl must be handled last, after same_body aliases,
      as following functions will use what it computed.  */
+  create_abstract_origin (current_function_decl);
   ipa_modify_formal_parameters (current_function_decl, adjustments, "ISRA");
   scan_function (sra_ipa_modify_expr, sra_ipa_modify_assign,
                 replace_removed_params_ssa_names, false, adjustments);