From f625098e0c1b2cbb0abc21b760b3fd4a1fb3d22b Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Wed, 7 Jul 2010 17:21:16 +0200 Subject: [PATCH] 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. From-SVN: r161918 --- gcc/ChangeLog | 6 ++++++ gcc/tree.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bd9cf806918..3a2fcf485d8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-07-07 Duncan Sands + + PR middle-end/41355 + * tree.c (build_function_type_skip_args): Copy the original type using + build_distinct_type_copy rather than copy_node. + 2010-07-07 H.J. Lu PR target/44850 diff --git a/gcc/tree.c b/gcc/tree.c index dda9287a190..2ddd1d87fe4 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -7350,7 +7350,7 @@ build_function_type_skip_args (tree orig_type, bitmap args_to_skip) 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