aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2013-12-18 10:34:00 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2013-12-18 10:34:00 +0000
commita4d47cacbdcbb9da9cd17c3b634a9b672a004aa6 (patch)
tree7f3383d6e4eab7aaaa10969fbe0b55e3dbbc85f1 /gcc
parent468f5fc95c5c1820014e074841310a7014862e47 (diff)
downloadgcc-a4d47cacbdcbb9da9cd17c3b634a9b672a004aa6.zip
gcc-a4d47cacbdcbb9da9cd17c3b634a9b672a004aa6.tar.gz
gcc-a4d47cacbdcbb9da9cd17c3b634a9b672a004aa6.tar.bz2
re PR debug/59418 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2221)
PR debug/59418 * dwarf2cfi.c (dwarf2out_frame_debug_cfa_offset): Fix comment and tidy. (dwarf2out_frame_debug_cfa_restore): Handle TARGET_DWARF_REGISTER_SPAN. (dwarf2out_frame_debug_expr): Tidy. From-SVN: r206084
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/dwarf2cfi.c46
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/pr59418.c35
4 files changed, 78 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d4f1196..52a1998 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2013-12-18 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR debug/59418
+ * dwarf2cfi.c (dwarf2out_frame_debug_cfa_offset): Fix comment and tidy.
+ (dwarf2out_frame_debug_cfa_restore): Handle TARGET_DWARF_REGISTER_SPAN.
+ (dwarf2out_frame_debug_expr): Tidy.
+
2013-12-18 Alexander Ivchenko <alexander.ivchenko@intel.com>
Maxim Kuznetsov <maxim.kuznetsov@intel.com>
Sergey Lega <sergey.s.lega@intel.com>
diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
index 330836b..7715299 100644
--- a/gcc/dwarf2cfi.c
+++ b/gcc/dwarf2cfi.c
@@ -1149,18 +1149,15 @@ dwarf2out_frame_debug_cfa_offset (rtx set)
else
{
/* We have a PARALLEL describing where the contents of SRC live.
- Queue register saves for each piece of the PARALLEL. */
- int par_index;
- int limit;
+ Adjust the offset for each piece of the PARALLEL. */
HOST_WIDE_INT span_offset = offset;
gcc_assert (GET_CODE (span) == PARALLEL);
- limit = XVECLEN (span, 0);
- for (par_index = 0; par_index < limit; par_index++)
+ const int par_len = XVECLEN (span, 0);
+ for (int par_index = 0; par_index < par_len; par_index++)
{
rtx elem = XVECEXP (span, 0, par_index);
-
sregno = dwf_regno (src);
reg_save (sregno, INVALID_REGNUM, span_offset);
span_offset += GET_MODE_SIZE (GET_MODE (elem));
@@ -1229,10 +1226,31 @@ dwarf2out_frame_debug_cfa_expression (rtx set)
static void
dwarf2out_frame_debug_cfa_restore (rtx reg)
{
- unsigned int regno = dwf_regno (reg);
+ gcc_assert (REG_P (reg));
+
+ rtx span = targetm.dwarf_register_span (reg);
+ if (!span)
+ {
+ unsigned int regno = dwf_regno (reg);
+ add_cfi_restore (regno);
+ update_row_reg_save (cur_row, regno, NULL);
+ }
+ else
+ {
+ /* We have a PARALLEL describing where the contents of REG live.
+ Restore the register for each piece of the PARALLEL. */
+ gcc_assert (GET_CODE (span) == PARALLEL);
- add_cfi_restore (regno);
- update_row_reg_save (cur_row, regno, NULL);
+ const int par_len = XVECLEN (span, 0);
+ for (int par_index = 0; par_index < par_len; par_index++)
+ {
+ reg = XVECEXP (span, 0, par_index);
+ gcc_assert (REG_P (reg));
+ unsigned int regno = dwf_regno (reg);
+ add_cfi_restore (regno);
+ update_row_reg_save (cur_row, regno, NULL);
+ }
+ }
}
/* A subroutine of dwarf2out_frame_debug, process a REG_CFA_WINDOW_SAVE.
@@ -1884,23 +1902,23 @@ dwarf2out_frame_debug_expr (rtx expr)
}
}
- span = NULL;
if (REG_P (src))
span = targetm.dwarf_register_span (src);
+ else
+ span = NULL;
+
if (!span)
queue_reg_save (src, NULL_RTX, offset);
else
{
/* We have a PARALLEL describing where the contents of SRC live.
Queue register saves for each piece of the PARALLEL. */
- int par_index;
- int limit;
HOST_WIDE_INT span_offset = offset;
gcc_assert (GET_CODE (span) == PARALLEL);
- limit = XVECLEN (span, 0);
- for (par_index = 0; par_index < limit; par_index++)
+ const int par_len = XVECLEN (span, 0);
+ for (int par_index = 0; par_index < par_len; par_index++)
{
rtx elem = XVECEXP (span, 0, par_index);
queue_reg_save (elem, NULL_RTX, span_offset);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 29110ef..f192b5d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2013-12-18 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.dg/pr59418.c: New test.
+
2013-12-17 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/59523
diff --git a/gcc/testsuite/gcc.dg/pr59418.c b/gcc/testsuite/gcc.dg/pr59418.c
new file mode 100644
index 0000000..114c1d3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr59418.c
@@ -0,0 +1,35 @@
+/* PR debug/59418 */
+/* Reported by Ryan Mansfield <rmansfield@qnx.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-Os -g" } */
+/* { dg-options "-march=armv7-a -mfloat-abi=hard -Os -g" { target arm*-*-* } } */
+
+extern int printf (const char *__format, ...);
+
+void
+foo (const char *pptr, int caplen)
+{
+ int type;
+ const char *tptr;
+ if (caplen < 4)
+ {
+ (void) printf ("foo");
+ return;
+ }
+ while (tptr < pptr)
+ {
+ switch (type)
+ {
+ case 0x01:
+ printf ("");
+ case 0x0b:
+ printf ("");
+ case 0x0e:
+ printf ("");
+ case 0x10:
+ printf ("%1.2fW", bar (tptr, caplen) / 1000.0);
+ }
+ }
+ printf ("foo");
+}