Patchwork Fix pr middle-end/41355

login
register
mail settings
Submitter Duncan Sands
Date July 7, 2010, 3:10 p.m.
Message ID <4C3498EA.1090803@free.fr>
Download mbox | patch
Permalink /patch/58123/
State New
Headers show

Comments

Duncan Sands - July 7, 2010, 3:10 p.m.
When materializing a cloned function with arguments removed,
to TYPE_POINTER_TO field of the new type (which has fewer
arguments) was left pointing to the original type.  Bootstraps
and passes regression testing (tested on the 4.5 branch since
4.6 seems ill right now).  Jan Hubicka says "it seems fine to me,
but I can not approve it".  OK to apply to mainline and 4.5?

Changelog entry:

  2010-07-07  Duncan Sands  <baldrick@free.fr>

  	PR middle-end/41355
  	* tree.c (build_function_type_skip_args): Copy the original type using
          build_distinct_type_copy rather than copy_node.
Diego Novillo - July 7, 2010, 3:18 p.m.
On 10-07-07 11:10 , Duncan Sands wrote:

> 2010-07-07 Duncan Sands <baldrick@free.fr>
>
> PR middle-end/41355
> * tree.c (build_function_type_skip_args): Copy the original type using
> build_distinct_type_copy rather than copy_node.

OK.


Diego.
Duncan Sands - July 7, 2010, 3:22 p.m.
>> PR middle-end/41355
>> * tree.c (build_function_type_skip_args): Copy the original type using
>> build_distinct_type_copy rather than copy_node.
>
> OK.
>
>
> Diego.

Thanks Diego.  Applied to mainline in commit 161918.

Ciao,

Duncan.

Patch

Index: tree.c
===================================================================
--- tree.c	(revision 161914)
+++ tree.c	(working copy)
@@ -7350,7 +7350,7 @@ 
    if (TREE_CODE (orig_type) != METHOD_TYPE
        || !bitmap_bit_p (args_to_skip, 0))
      {
-      new_type = copy_node (orig_type);
+      new_type = build_distinct_type_copy (orig_type);
        TYPE_ARG_TYPES (new_type) = new_reversed;
      }
    else