public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/48178] New: ICE in dwarf2out_var_location, at dwarf2out.c:21969
@ 2011-03-18 12:42 kkojima at gcc dot gnu.org
  2011-03-22 23:40 ` [Bug debug/48178] [4.7 Regression] " kkojima at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: kkojima at gcc dot gnu.org @ 2011-03-18 12:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48178

           Summary: ICE in dwarf2out_var_location, at dwarf2out.c:21969
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: kkojima@gcc.gnu.org


On SH, gcc.c-torture/compile/sync-2.c fails with

  internal compiler error: in dwarf2out_var_location, at dwarf2out.c:21969

It seems that dwarf2out_var_location assumes the previous insn
of the loc_note insn is a call or sequence insn, but for
the problematic case, it's an unspec insn for the constant pool:

(gdb) call debug_rtx(prev)
(insn 603 602 604 (unspec_volatile [
            (const_int 0 [0])
        ] 11) 295 {consttable_end}
     (nil))

at the failed gcc_assert

21965          gcc_assert (prev
21966              && (CALL_P (prev)
21967                  || (NONJUMP_INSN_P (prev)
21968                  && GET_CODE (PATTERN (prev)) == SEQUENCE
21969                  && CALL_P (XVECEXP (PATTERN (prev), 0, 0)))));

The patch below looks to work for me, though I'm not sure that
it's the right thing to do.

--- ORIG/trunk/gcc/dwarf2out.c    2011-03-17 09:06:42.000000000 +0900
+++ LOCAL/trunk/gcc/dwarf2out.c    2011-03-17 13:03:39.000000000 +0900
@@ -21962,11 +21962,17 @@ dwarf2out_var_location (rtx loc_note)
       ca_loc->call_arg_loc_note = loc_note;
       ca_loc->next = NULL;
       ca_loc->label = last_label;
-      gcc_assert (prev
-          && (CALL_P (prev)
-              || (NONJUMP_INSN_P (prev)
-              && GET_CODE (PATTERN (prev)) == SEQUENCE
-              && CALL_P (XVECEXP (PATTERN (prev), 0, 0)))));
+      while (prev)
+    {
+      if (CALL_P (prev)
+          || (NONJUMP_INSN_P (prev)
+          && GET_CODE (PATTERN (prev)) == SEQUENCE
+          && CALL_P (XVECEXP (PATTERN (prev), 0, 0))))
+        break;
+      else
+        prev = prev_real_insn (prev);
+    }
+      gcc_assert (prev);
       if (!CALL_P (prev))
     prev = XVECEXP (PATTERN (prev), 0, 0);
       ca_loc->tail_call_p = SIBLING_CALL_P (prev);


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug debug/48178] [4.7 Regression] ICE in dwarf2out_var_location, at dwarf2out.c:21969
  2011-03-18 12:42 [Bug debug/48178] New: ICE in dwarf2out_var_location, at dwarf2out.c:21969 kkojima at gcc dot gnu.org
@ 2011-03-22 23:40 ` kkojima at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: kkojima at gcc dot gnu.org @ 2011-03-22 23:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48178

Kazumoto Kojima <kkojima at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Kazumoto Kojima <kkojima at gcc dot gnu.org> 2011-03-22 22:45:56 UTC ---
I've applied a target specific patch so not to emit a constant
pool between a call and its corresponding CALL_ARG_LOCATION note:

http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01213.html


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-22 22:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-18 12:42 [Bug debug/48178] New: ICE in dwarf2out_var_location, at dwarf2out.c:21969 kkojima at gcc dot gnu.org
2011-03-22 23:40 ` [Bug debug/48178] [4.7 Regression] " kkojima at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).