This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[cfg-branch] location lists fixes
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, gcc-pdo at atrey dot karlin dot mff dot cuni dot cz, dan at dberlin dot org
- Date: Wed, 27 Mar 2002 17:12:14 +0100
- Subject: [cfg-branch] location lists fixes
Hi,
your location list code dies on i386 bootstrap in several cases. I've
fixed the crashes, but I don't have enought time today to understand the
code better, so I think I've just fixed the symptoms, not real problems
in number of cases.
I am going to check in the change, as keeping the tree bootstrapping is
important for preformance testing. Hope you will know how to fix it
better.
Please next time try to check whether tree still bootstraps, so the
testing will keep functional.
Honza
Wed Mar 27 17:07:16 CET 2002 Jan Hubicka <jh@suse.cz>
* dwarf2out.c (loc_descriptor): Avoid some dead corners.
(add_location_or_const_value_attribute): Avoid crash on null
current_fucntion_decl.
Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/dwarf2out.c,v
retrieving revision 1.328.2.14
diff -c -3 -p -r1.328.2.14 dwarf2out.c
*** dwarf2out.c 2002/03/25 17:12:03 1.328.2.14
--- dwarf2out.c 2002/03/27 16:07:08
*************** loc_descriptor (rtl)
*** 8053,8058 ****
--- 8053,8061 ----
{
dw_loc_descr_ref loc_result = NULL;
+ if (!rtl)
+ return 0;
+
switch (GET_CODE (rtl))
{
case SUBREG:
*************** loc_descriptor (rtl)
*** 8104,8110 ****
}
break;
default:
! abort ();
}
return loc_result;
--- 8107,8113 ----
}
break;
default:
! return 0;
}
return loc_result;
*************** add_location_or_const_value_attribute (d
*** 9100,9106 ****
if (DECL_SECTION_NAME (decl))
secname = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
! else if (DECL_SECTION_NAME (current_function_decl))
secname = TREE_STRING_POINTER (DECL_SECTION_NAME (current_function_decl));
else
secname = TEXT_SECTION_NAME;
--- 9103,9110 ----
if (DECL_SECTION_NAME (decl))
secname = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
! else if (current_function_decl
! && DECL_SECTION_NAME (current_function_decl))
secname = TREE_STRING_POINTER (DECL_SECTION_NAME (current_function_decl));
else
secname = TEXT_SECTION_NAME;