This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR 28980, ICE with some VLA with functions and -g
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 13 Sep 2006 17:14:18 -0700
- Subject: [PATCH] Fix PR 28980, ICE with some VLA with functions and -g
The problem here is that loc_descriptor_from_tree_1 is not ready to
handle FUNCTION_DECL so we get a crash. This fixes the crash by
handling FUNCTION_DECL like any other decl would be handled.
OK? Bootstrapped and tested on i686-linux-gnu.
:ADDPATCH debug:
Thanks,
Andrew Pinski
ChangeLog:
* dwarf2out.c (loc_descriptor_from_tree_1): Handle
FUNCTION_DECL.
testsuite/ChangeLog:
* gcc.c-torture/compile/debugvlafunction-1.c: New test.
Index: testsuite/gcc.c-torture/compile/debugvlafunction-1.c
===================================================================
--- testsuite/gcc.c-torture/compile/debugvlafunction-1.c (revision 0)
+++ testsuite/gcc.c-torture/compile/debugvlafunction-1.c (revision 0)
@@ -0,0 +1,11 @@
+extern void dynreplace_trampoline(void);
+extern void dynreplace_trampoline_endlabel(void);
+int dynreplace_add_trampoline(void)
+{
+ unsigned long trampoline_code[(((unsigned long)
+(&(dynreplace_trampoline_endlabel))
+-(unsigned long) (&dynreplace_trampoline)))
+];
+}
+
+
Index: dwarf2out.c
===================================================================
--- dwarf2out.c (revision 116919)
+++ dwarf2out.c (working copy)
@@ -9167,6 +9167,7 @@ loc_descriptor_from_tree_1 (tree loc, in
/* FALLTHRU */
case RESULT_DECL:
+ case FUNCTION_DECL:
{
rtx rtl = rtl_for_decl_location (loc);