re PR debug/69705 (segfault in libgomp.fortran/task1.f90 with -flto -fno-use-linker-plugin -fno-toplevel-reorder -O1 -g)

PR debug/69705
	* dwarf2out.c (gen_variable_die): Work around buggy LTO
	- allow NULL decl for Fortran DW_TAG_common_block variables.

From-SVN: r233685
This commit is contained in:
Jakub Jelinek 2016-02-24 23:04:09 +01:00
parent 03ca8fb3da
commit 4429358036
3 changed files with 15 additions and 7 deletions

View file

@ -1,9 +1,15 @@
2016-02-24 Jakub Jelinek <jakub@redhat.com>
PR debug/69705
* dwarf2out.c (gen_variable_die): Work around buggy LTO
- allow NULL decl for Fortran DW_TAG_common_block variables.
2016-02-24 Jason Merrill <jason@redhat.com>
* common.opt (flifetime-dse): Add -flifetime-dse=1.
2016-02-24 Richard Biener <rguenther@suse.de>
Jakub Jelinek <jakub@redhat.com>
Jakub Jelinek <jakub@redhat.com>
PR middle-end/69760
* tree-scalar-evolution.c (interpret_rhs_expr): Re-write

View file

@ -21055,7 +21055,7 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die)
DW_TAG_common_block and DW_TAG_variable. */
loc = loc_list_from_tree (com_decl, 2, NULL);
}
else if (DECL_EXTERNAL (decl))
else if (DECL_EXTERNAL (decl_or_origin))
add_AT_flag (com_die, DW_AT_declaration, 1);
if (want_pubnames ())
add_pubname_string (cnam, com_die); /* ??? needed? */
@ -21070,8 +21070,9 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die)
remove_AT (com_die, DW_AT_declaration);
}
var_die = new_die (DW_TAG_variable, com_die, decl);
add_name_and_src_coords_attributes (var_die, decl);
add_type_attribute (var_die, TREE_TYPE (decl), decl_quals (decl), false,
add_name_and_src_coords_attributes (var_die, decl_or_origin);
add_type_attribute (var_die, TREE_TYPE (decl_or_origin),
decl_quals (decl_or_origin), false,
context_die);
add_AT_flag (var_die, DW_AT_external, 1);
if (loc)
@ -21093,9 +21094,10 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die)
}
add_AT_location_description (var_die, DW_AT_location, loc);
}
else if (DECL_EXTERNAL (decl))
else if (DECL_EXTERNAL (decl_or_origin))
add_AT_flag (var_die, DW_AT_declaration, 1);
equate_decl_number_to_die (decl, var_die);
if (decl)
equate_decl_number_to_die (decl, var_die);
return;
}

View file

@ -28,7 +28,7 @@
* g++.dg/pr61033.C: Add a regression testcase for PR debug/61033.
2016-02-24 Richard Biener <rguenther@suse.de>
Jakub Jelinek <jakub@redhat.com>
Jakub Jelinek <jakub@redhat.com>
PR middle-end/69760
* gcc.dg/torture/pr69760.c: New testcase.