aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-08-24 02:10:12 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2004-08-24 02:10:12 +0000
commitc3f216e234fe475b33532d5ac54dbde1aaa67a05 (patch)
tree457de2a6db5484f9007c589e6f24dac1017aab1e /gcc
parenta9b5a054c9f01420bb53f371cdc32ee622e12041 (diff)
downloadgcc-c3f216e234fe475b33532d5ac54dbde1aaa67a05.zip
gcc-c3f216e234fe475b33532d5ac54dbde1aaa67a05.tar.gz
gcc-c3f216e234fe475b33532d5ac54dbde1aaa67a05.tar.bz2
re PR debug/14492 (loc_descriptor_from_tree, in dwarf2out.c:9031)
PR c/14492 * dwarf2out.c (loc_descriptor_from_tree): Robustify. PR c/14492 * gcc.dg/debug/crash1.c: New test. From-SVN: r86461
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/dwarf2out.c6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/debug/crash1.c8
4 files changed, 24 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0667a1a..89100e9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-08-23 Mark Mitchell <mark@codesourcery.com>
+
+ PR c/14492
+ * dwarf2out.c (loc_descriptor_from_tree): Robustify.
+
2004-08-23 Diego Novillo <dnovillo@redhat.com>
* cfg.c (check_bb_profile): Fix typos.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 4d9a1b2..02cbef3 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -9244,9 +9244,15 @@ loc_descriptor_from_tree_1 (tree loc, int want_address)
>= (unsigned int) LAST_AND_UNUSED_TREE_CODE)
return 0;
+#ifdef ENABLE_CHECKING
/* Otherwise this is a generic code; we should just lists all of
these explicitly. Aborting means we forgot one. */
abort ();
+#else
+ /* In a release build, we want to degrade gracefully: better to
+ generate incomplete debugging information than to crash. */
+ return NULL;
+#endif
}
/* Show if we can't fill the request for an address. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7a3fde2..5c68863 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2004-08-23 Mark Mitchell <mark@codesourcery.com>
+ PR c/14492
+ * gcc.dg/debug/crash1.c: New test.
+
+2004-08-23 Mark Mitchell <mark@codesourcery.com>
+
PR c/16180
* gcc.dg/loop-5.c: New test.
diff --git a/gcc/testsuite/gcc.dg/debug/crash1.c b/gcc/testsuite/gcc.dg/debug/crash1.c
new file mode 100644
index 0000000..259e259
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/crash1.c
@@ -0,0 +1,8 @@
+/* PR c/14492 */
+/* { dg-options "" } */
+
+int main() {
+ double d = 1.0;
+ char x[(int) d];
+ return 0;
+}