+2012-08-06  Cary Coutant  <ccoutant@google.com>
+
+       * cgraphunit.c (assemble_thunk): Add source line info.
+       * final.c (final): Check for non-null cfg pointer.
+
 2012-08-06  Sandra Loosemore  <sandra@codesourcery.com>
            Maxim Kuvyrkov  <maxim@codesourcery.com>
            Julian Brown  <julian@codesourcery.com>
 
       init_function_start (thunk_fndecl);
       cfun->is_thunk = 1;
       assemble_start_function (thunk_fndecl, fnname);
+      (*debug_hooks->source_line) (DECL_SOURCE_LINE (thunk_fndecl),
+                                  DECL_SOURCE_FILE (thunk_fndecl),
+                                  /* discriminator */ 0,
+                                  /* is_stmt */ 1);
 
       targetm.asm_out.output_mi_thunk (asm_out_file, thunk_fndecl,
                                       fixed_offset, virtual_value, alias);
 
       start_to_bb = XCNEWVEC (basic_block, bb_map_size);
       end_to_bb = XCNEWVEC (basic_block, bb_map_size);
 
-      FOR_EACH_BB_REVERSE (bb)
-       {
-         start_to_bb[INSN_UID (BB_HEAD (bb))] = bb;
-         end_to_bb[INSN_UID (BB_END (bb))] = bb;
-       }
+      /* There is no cfg for a thunk.  */
+      if (!cfun->is_thunk)
+       FOR_EACH_BB_REVERSE (bb)
+         {
+           start_to_bb[INSN_UID (BB_HEAD (bb))] = bb;
+           end_to_bb[INSN_UID (BB_END (bb))] = bb;
+         }
     }
 
   /* Output the insns.  */
 
+2012-08-06  Cary Coutant  <ccoutant@google.com>
+
+       * g++.dg/debug/dwarf2/non-virtual-thunk.C: New test case.
+
 2012-08-06  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/35831
 
--- /dev/null
+// { dg-do compile }
+// { dg-options "-g2 -dA" }
+
+// Verify that line number info is output for the non-virtual
+// thunks for C::~C().
+// { dg-final { scan-assembler "thunk.C:30" } }
+
+class A
+{
+ public:
+  A();
+  virtual ~A();
+ private:
+  int i;
+};
+
+class B
+{
+ public:
+  B();
+  virtual ~B();
+ private:
+  int i;
+};
+
+class C : public A, public B
+{
+ public:
+  C();
+  virtual ~C(); // line 30
+};
+
+C::C()
+{
+}
+
+C::~C()
+{
+}