Merge lp:~rsandifo/gcc-linaro/lp-714921-4.6 into lp:gcc-linaro/4.6

Proposed by Richard Sandiford
Status: Merged
Merged at revision: 106740
Proposed branch: lp:~rsandifo/gcc-linaro/lp-714921-4.6
Merge into: lp:gcc-linaro/4.6
Diff against target: 310 lines (+149/-19) (has conflicts)
2 files modified
gcc/ChangeLog (+28/-0)
gcc/dwarf2out.c (+121/-19)
Text conflict in gcc/ChangeLog
To merge this branch: bzr merge lp:~rsandifo/gcc-linaro/lp-714921-4.6
Reviewer Review Type Date Requested Status
Ramana Radhakrishnan (community) Approve
Review via email: mp+58653@code.launchpad.net

Description of the change

Simple backport of 4.7 patch.

To post a comment you must log in.
Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild has taken a snapshot of this branch at r106545 and queued it for build.

The snapshot is available at:
 http://ex.seabright.co.nz/snapshots/gcc-linaro-4.6+bzr106545~rsandifo~lp-714921-4.6.tar.xdelta3.xz

and will be built on the following builders:
 a9-builder i686 x86_64

You can track the build queue at:
 http://ex.seabright.co.nz/helpers/scheduler

cbuild-snapshot: gcc-linaro-4.6+bzr106545~rsandifo~lp-714921-4.6
cbuild-ancestor: lp:gcc-linaro/4.6+bzr106544
cbuild-state: check

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on i686-lucid-cbuild112-scorpius-i686r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106545~rsandifo~lp-714921-4.6/logs/i686-lucid-cbuild112-scorpius-i686r1

The test suite results were unchanged compared to the branch point lp:gcc-linaro/4.6+bzr106544.

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106545~rsandifo~lp-714921-4.6/logs/i686-lucid-cbuild112-scorpius-i686r1/gcc-testsuite.txt

cbuild-checked: i686-lucid-cbuild112-scorpius-i686r1

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on x86_64-maverick-cbuild112-crucis-x86_64r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106545~rsandifo~lp-714921-4.6/logs/x86_64-maverick-cbuild112-crucis-x86_64r1

The test suite results were unchanged compared to the branch point lp:gcc-linaro/4.6+bzr106544.

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106545~rsandifo~lp-714921-4.6/logs/x86_64-maverick-cbuild112-crucis-x86_64r1/gcc-testsuite.txt

cbuild-checked: x86_64-maverick-cbuild112-crucis-x86_64r1

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on armv7l-maverick-cbuild112-ursa2-cortexa9r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106545~rsandifo~lp-714921-4.6/logs/armv7l-maverick-cbuild112-ursa2-cortexa9r1

The test suite results changed compared to the branch point lp:gcc-linaro/4.6+bzr106544:
 -FAIL: largefile.c -O0 -I. (internal compiler error)
 -FAIL: largefile.c -O0 -I. (test for excess errors)
 +PASS: largefile.c -O0 -I. (test for excess errors)
 -PASS: ext/mt_allocator/tune-4.cc execution test
 +FAIL: ext/mt_allocator/tune-4.cc execution test
 +WARNING: program timed out.

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106545~rsandifo~lp-714921-4.6/logs/armv7l-maverick-cbuild112-ursa2-cortexa9r1/gcc-testsuite.txt

cbuild-checked: armv7l-maverick-cbuild112-ursa2-cortexa9r1

Revision history for this message
Ramana Radhakrishnan (ramana) wrote :

 -PASS: ext/mt_allocator/tune-4.cc execution test
 +FAIL: ext/mt_allocator/tune-4.cc execution test

I'm a bit concerned about the extra failure here with a time-out . Could you have a quick look at this ?

Ramana

Revision history for this message
Richard Sandiford (rsandifo) wrote :

> -PASS: ext/mt_allocator/tune-4.cc execution test
> +FAIL: ext/mt_allocator/tune-4.cc execution test
>
> I'm a bit concerned about the extra failure here with a time-out . Could you
> have a quick look at this ?

Sure, np. I checked that it does pass locally on my Beagleboard. I also
checked that there were no code changes in the testcase: stripping both
the "before" and "after" executables gives output that is byte-for-byte
identical. The only difference between the original (non-stripped)
executables is that the debug info in the "after" executable is smaller.

That's all as hoped, of course. The patch is just supposed to change
the debug information, and is supposed to remove redundant location lists.

Richard

Revision history for this message
Ramana Radhakrishnan (ramana) wrote :

Approved but watch out for potential conflicts in Changelog and add an entry to Changelog.linaro.

cheers
Ramana

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'gcc/ChangeLog'
--- gcc/ChangeLog 2011-04-07 10:52:12 +0000
+++ gcc/ChangeLog 2011-04-21 11:59:30 +0000
@@ -1,3 +1,4 @@
1<<<<<<< TREE
12011-04-01 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>22011-04-01 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
23
3 * config/spu/t-spu-elf (dp-bit.c): Use > instead of >>.4 * config/spu/t-spu-elf (dp-bit.c): Use > instead of >>.
@@ -2106,6 +2107,33 @@
2106 * config/darwin.c (SECTION_NO_ANCHOR): Define.2107 * config/darwin.c (SECTION_NO_ANCHOR): Define.
2107 (darwin_init_sections): Remove assertion.2108 (darwin_init_sections): Remove assertion.
21082109
2110=======
21112011-04-21 Richard Sandiford <richard.sandiford@linaro.org>
2112
2113 Backport from mainline:
2114
2115 2011-03-29 Richard Sandiford <richard.sandiford@linaro.org>
2116
2117 PR debug/48190
2118 * dwarf2out.c (dw_loc_list_node): Add resolved_addr and replaced.
2119 (cached_dw_loc_list_def): New structure.
2120 (cached_dw_loc_list): New typedef.
2121 (cached_dw_loc_list_table): New variable.
2122 (cached_dw_loc_list_table_hash): New function.
2123 (cached_dw_loc_list_table_eq): Likewise.
2124 (add_location_or_const_value_attribute): Take a bool cache_p.
2125 Cache the list when the parameter is true.
2126 (gen_formal_parameter_die): Update caller.
2127 (gen_variable_die): Likewise.
2128 (dwarf2out_finish): Likewise.
2129 (dwarf2out_abstract_function): Nullify cached_dw_loc_list_table
2130 while generating debug info for the decl.
2131 (dwarf2out_function_decl): Clear cached_dw_loc_list_table.
2132 (dwarf2out_init): Initialize cached_dw_loc_list_table.
2133 (resolve_addr): Cache the result of resolving a chain of
2134 location lists.
2135
2136>>>>>>> MERGE-SOURCE
21092011-02-03 Nick Clifton <nickc@redhat.com>21372011-02-03 Nick Clifton <nickc@redhat.com>
21102138
2111 * config/rx/predicates.md (rx_zs_comparison_operator): Remove2139 * config/rx/predicates.md (rx_zs_comparison_operator): Remove
21122140
=== modified file 'gcc/dwarf2out.c'
--- gcc/dwarf2out.c 2011-03-29 22:47:59 +0000
+++ gcc/dwarf2out.c 2011-04-21 11:59:30 +0000
@@ -4427,6 +4427,11 @@
4427 const char *section; /* Section this loclist is relative to */4427 const char *section; /* Section this loclist is relative to */
4428 dw_loc_descr_ref expr;4428 dw_loc_descr_ref expr;
4429 hashval_t hash;4429 hashval_t hash;
4430 /* True if all addresses in this and subsequent lists are known to be
4431 resolved. */
4432 bool resolved_addr;
4433 /* True if this list has been replaced by dw_loc_next. */
4434 bool replaced;
4430 bool emitted;4435 bool emitted;
4431} dw_loc_list_node;4436} dw_loc_list_node;
44324437
@@ -6087,6 +6092,19 @@
6087/* Table of decl location linked lists. */6092/* Table of decl location linked lists. */
6088static GTY ((param_is (var_loc_list))) htab_t decl_loc_table;6093static GTY ((param_is (var_loc_list))) htab_t decl_loc_table;
60896094
6095/* A cached location list. */
6096struct GTY (()) cached_dw_loc_list_def {
6097 /* The DECL_UID of the decl that this entry describes. */
6098 unsigned int decl_id;
6099
6100 /* The cached location list. */
6101 dw_loc_list_ref loc_list;
6102};
6103typedef struct cached_dw_loc_list_def cached_dw_loc_list;
6104
6105/* Table of cached location lists. */
6106static GTY ((param_is (cached_dw_loc_list))) htab_t cached_dw_loc_list_table;
6107
6090/* A pointer to the base of a list of references to DIE's that6108/* A pointer to the base of a list of references to DIE's that
6091 are uniquely identified by their tag, presence/absence of6109 are uniquely identified by their tag, presence/absence of
6092 children DIE's, and list of attribute/value pairs. */6110 children DIE's, and list of attribute/value pairs. */
@@ -6434,7 +6452,7 @@
6434static void insert_double (double_int, unsigned char *);6452static void insert_double (double_int, unsigned char *);
6435static void insert_float (const_rtx, unsigned char *);6453static void insert_float (const_rtx, unsigned char *);
6436static rtx rtl_for_decl_location (tree);6454static rtx rtl_for_decl_location (tree);
6437static bool add_location_or_const_value_attribute (dw_die_ref, tree,6455static bool add_location_or_const_value_attribute (dw_die_ref, tree, bool,
6438 enum dwarf_attribute);6456 enum dwarf_attribute);
6439static bool tree_add_const_value_attribute (dw_die_ref, tree);6457static bool tree_add_const_value_attribute (dw_die_ref, tree);
6440static bool tree_add_const_value_attribute_for_decl (dw_die_ref, tree);6458static bool tree_add_const_value_attribute_for_decl (dw_die_ref, tree);
@@ -8168,6 +8186,24 @@
8168 htab_find_with_hash (decl_loc_table, decl, DECL_UID (decl));8186 htab_find_with_hash (decl_loc_table, decl, DECL_UID (decl));
8169}8187}
81708188
8189/* Returns a hash value for X (which really is a cached_dw_loc_list_list). */
8190
8191static hashval_t
8192cached_dw_loc_list_table_hash (const void *x)
8193{
8194 return (hashval_t) ((const cached_dw_loc_list *) x)->decl_id;
8195}
8196
8197/* Return nonzero if decl_id of cached_dw_loc_list X is the same as
8198 UID of decl *Y. */
8199
8200static int
8201cached_dw_loc_list_table_eq (const void *x, const void *y)
8202{
8203 return (((const cached_dw_loc_list *) x)->decl_id
8204 == DECL_UID ((const_tree) y));
8205}
8206
8171/* Equate a DIE to a particular declaration. */8207/* Equate a DIE to a particular declaration. */
81728208
8173static void8209static void
@@ -16965,15 +17001,22 @@
16965 these things can crop up in other ways also.) Note that one type of17001 these things can crop up in other ways also.) Note that one type of
16966 constant value which can be passed into an inlined function is a constant17002 constant value which can be passed into an inlined function is a constant
16967 pointer. This can happen for example if an actual argument in an inlined17003 pointer. This can happen for example if an actual argument in an inlined
16968 function call evaluates to a compile-time constant address. */17004 function call evaluates to a compile-time constant address.
17005
17006 CACHE_P is true if it is worth caching the location list for DECL,
17007 so that future calls can reuse it rather than regenerate it from scratch.
17008 This is true for BLOCK_NONLOCALIZED_VARS in inlined subroutines,
17009 since we will need to refer to them each time the function is inlined. */
1696917010
16970static bool17011static bool
16971add_location_or_const_value_attribute (dw_die_ref die, tree decl,17012add_location_or_const_value_attribute (dw_die_ref die, tree decl, bool cache_p,
16972 enum dwarf_attribute attr)17013 enum dwarf_attribute attr)
16973{17014{
16974 rtx rtl;17015 rtx rtl;
16975 dw_loc_list_ref list;17016 dw_loc_list_ref list;
16976 var_loc_list *loc_list;17017 var_loc_list *loc_list;
17018 cached_dw_loc_list *cache;
17019 void **slot;
1697717020
16978 if (TREE_CODE (decl) == ERROR_MARK)17021 if (TREE_CODE (decl) == ERROR_MARK)
16979 return false;17022 return false;
@@ -17010,7 +17053,33 @@
17010 && add_const_value_attribute (die, rtl))17053 && add_const_value_attribute (die, rtl))
17011 return true;17054 return true;
17012 }17055 }
17013 list = loc_list_from_tree (decl, decl_by_reference_p (decl) ? 0 : 2);17056 /* If this decl is from BLOCK_NONLOCALIZED_VARS, we might need its
17057 list several times. See if we've already cached the contents. */
17058 list = NULL;
17059 if (loc_list == NULL || cached_dw_loc_list_table == NULL)
17060 cache_p = false;
17061 if (cache_p)
17062 {
17063 cache = (cached_dw_loc_list *)
17064 htab_find_with_hash (cached_dw_loc_list_table, decl, DECL_UID (decl));
17065 if (cache)
17066 list = cache->loc_list;
17067 }
17068 if (list == NULL)
17069 {
17070 list = loc_list_from_tree (decl, decl_by_reference_p (decl) ? 0 : 2);
17071 /* It is usually worth caching this result if the decl is from
17072 BLOCK_NONLOCALIZED_VARS and if the list has at least two elements. */
17073 if (cache_p && list && list->dw_loc_next)
17074 {
17075 slot = htab_find_slot_with_hash (cached_dw_loc_list_table, decl,
17076 DECL_UID (decl), INSERT);
17077 cache = ggc_alloc_cleared_cached_dw_loc_list ();
17078 cache->decl_id = DECL_UID (decl);
17079 cache->loc_list = list;
17080 *slot = cache;
17081 }
17082 }
17014 if (list)17083 if (list)
17015 {17084 {
17016 add_AT_location_description (die, attr, list);17085 add_AT_location_description (die, attr, list);
@@ -18702,7 +18771,7 @@
18702 equate_decl_number_to_die (node, parm_die);18771 equate_decl_number_to_die (node, parm_die);
18703 if (! DECL_ABSTRACT (node_or_origin))18772 if (! DECL_ABSTRACT (node_or_origin))
18704 add_location_or_const_value_attribute (parm_die, node_or_origin,18773 add_location_or_const_value_attribute (parm_die, node_or_origin,
18705 DW_AT_location);18774 node == NULL, DW_AT_location);
1870618775
18707 break;18776 break;
1870818777
@@ -18887,6 +18956,7 @@
18887 tree context;18956 tree context;
18888 int was_abstract;18957 int was_abstract;
18889 htab_t old_decl_loc_table;18958 htab_t old_decl_loc_table;
18959 htab_t old_cached_dw_loc_list_table;
1889018960
18891 /* Make sure we have the actual abstract inline, not a clone. */18961 /* Make sure we have the actual abstract inline, not a clone. */
18892 decl = DECL_ORIGIN (decl);18962 decl = DECL_ORIGIN (decl);
@@ -18901,6 +18971,8 @@
18901 get locations in abstract instantces. */18971 get locations in abstract instantces. */
18902 old_decl_loc_table = decl_loc_table;18972 old_decl_loc_table = decl_loc_table;
18903 decl_loc_table = NULL;18973 decl_loc_table = NULL;
18974 old_cached_dw_loc_list_table = cached_dw_loc_list_table;
18975 cached_dw_loc_list_table = NULL;
1890418976
18905 /* Be sure we've emitted the in-class declaration DIE (if any) first, so18977 /* Be sure we've emitted the in-class declaration DIE (if any) first, so
18906 we don't get confused by DECL_ABSTRACT. */18978 we don't get confused by DECL_ABSTRACT. */
@@ -18925,6 +18997,7 @@
1892518997
18926 current_function_decl = save_fn;18998 current_function_decl = save_fn;
18927 decl_loc_table = old_decl_loc_table;18999 decl_loc_table = old_decl_loc_table;
19000 cached_dw_loc_list_table = old_cached_dw_loc_list_table;
18928 pop_cfun ();19001 pop_cfun ();
18929}19002}
1893019003
@@ -19709,9 +19782,8 @@
19709 && !TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl_or_origin)))19782 && !TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl_or_origin)))
19710 defer_location (decl_or_origin, var_die);19783 defer_location (decl_or_origin, var_die);
19711 else19784 else
19712 add_location_or_const_value_attribute (var_die,19785 add_location_or_const_value_attribute (var_die, decl_or_origin,
19713 decl_or_origin,19786 decl == NULL, DW_AT_location);
19714 DW_AT_location);
19715 add_pubname (decl_or_origin, var_die);19787 add_pubname (decl_or_origin, var_die);
19716 }19788 }
19717 else19789 else
@@ -21498,6 +21570,7 @@
21498 dwarf2out_decl (decl);21570 dwarf2out_decl (decl);
2149921571
21500 htab_empty (decl_loc_table);21572 htab_empty (decl_loc_table);
21573 htab_empty (cached_dw_loc_list_table);
21501}21574}
2150221575
21503/* Output a marker (i.e. a label) for the beginning of the generated code for21576/* Output a marker (i.e. a label) for the beginning of the generated code for
@@ -22230,6 +22303,11 @@
22230 decl_loc_table = htab_create_ggc (10, decl_loc_table_hash,22303 decl_loc_table = htab_create_ggc (10, decl_loc_table_hash,
22231 decl_loc_table_eq, NULL);22304 decl_loc_table_eq, NULL);
2223222305
22306 /* Allocate the cached_dw_loc_list_table. */
22307 cached_dw_loc_list_table
22308 = htab_create_ggc (10, cached_dw_loc_list_table_hash,
22309 cached_dw_loc_list_table_eq, NULL);
22310
22233 /* Allocate the initial hunk of the decl_scope_table. */22311 /* Allocate the initial hunk of the decl_scope_table. */
22234 decl_scope_table = VEC_alloc (tree, gc, 256);22312 decl_scope_table = VEC_alloc (tree, gc, 256);
2223522313
@@ -22870,30 +22948,53 @@
22870{22948{
22871 dw_die_ref c;22949 dw_die_ref c;
22872 dw_attr_ref a;22950 dw_attr_ref a;
22873 dw_loc_list_ref *curr;22951 dw_loc_list_ref *curr, *start, loc;
22874 unsigned ix;22952 unsigned ix;
2287522953
22876 FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)22954 FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)
22877 switch (AT_class (a))22955 switch (AT_class (a))
22878 {22956 {
22879 case dw_val_class_loc_list:22957 case dw_val_class_loc_list:
22880 curr = AT_loc_list_ptr (a);22958 start = curr = AT_loc_list_ptr (a);
22881 while (*curr)22959 loc = *curr;
22960 gcc_assert (loc);
22961 /* The same list can be referenced more than once. See if we have
22962 already recorded the result from a previous pass. */
22963 if (loc->replaced)
22964 *curr = loc->dw_loc_next;
22965 else if (!loc->resolved_addr)
22882 {22966 {
22883 if (!resolve_addr_in_expr ((*curr)->expr))22967 /* As things stand, we do not expect or allow one die to
22968 reference a suffix of another die's location list chain.
22969 References must be identical or completely separate.
22970 There is therefore no need to cache the result of this
22971 pass on any list other than the first; doing so
22972 would lead to unnecessary writes. */
22973 while (*curr)
22884 {22974 {
22885 dw_loc_list_ref next = (*curr)->dw_loc_next;22975 gcc_assert (!(*curr)->replaced && !(*curr)->resolved_addr);
22886 if (next && (*curr)->ll_symbol)22976 if (!resolve_addr_in_expr ((*curr)->expr))
22887 {22977 {
22888 gcc_assert (!next->ll_symbol);22978 dw_loc_list_ref next = (*curr)->dw_loc_next;
22889 next->ll_symbol = (*curr)->ll_symbol;22979 if (next && (*curr)->ll_symbol)
22980 {
22981 gcc_assert (!next->ll_symbol);
22982 next->ll_symbol = (*curr)->ll_symbol;
22983 }
22984 *curr = next;
22890 }22985 }
22891 *curr = next;22986 else
22987 curr = &(*curr)->dw_loc_next;
22892 }22988 }
22989 if (loc == *start)
22990 loc->resolved_addr = 1;
22893 else22991 else
22894 curr = &(*curr)->dw_loc_next;22992 {
22993 loc->replaced = 1;
22994 loc->dw_loc_next = *start;
22995 }
22895 }22996 }
22896 if (!AT_loc_list (a))22997 if (!*start)
22897 {22998 {
22898 remove_AT (die, a->dw_attr);22999 remove_AT (die, a->dw_attr);
22899 ix--;23000 ix--;
@@ -23322,6 +23423,7 @@
23322 add_location_or_const_value_attribute (23423 add_location_or_const_value_attribute (
23323 VEC_index (deferred_locations, deferred_locations_list, i)->die,23424 VEC_index (deferred_locations, deferred_locations_list, i)->die,
23324 VEC_index (deferred_locations, deferred_locations_list, i)->variable,23425 VEC_index (deferred_locations, deferred_locations_list, i)->variable,
23426 false,
23325 DW_AT_location);23427 DW_AT_location);
23326 }23428 }
2332723429

Subscribers

People subscribed via source and target branches