This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR17544, a C99 and C++ Wunreachable-code problem


On Friday 31 December 2004 13:43, Gabriel Dos Reis wrote:
> Steven Bosscher <stevenb@suse.de> writes:
>
> [...]
>
> | My proposed fix is to put a locus on the compiler generated statement
> | in the front end: just put it in the current file, on line 0.  Then
>
> Aren't those loci information used by the debugger?

Yes, but apparently line 0 is not written to the assembly output:

     1  void __attribute__ ((noinline)) foo (void) {};
     2  int
     3  main (void)
     4  {
     5    foo ();
     6  }


The ".oplower" tree dump:
;; Function main (main)

main ()
{
  int D.1387;

<bb 0>:
  [t.c : 5] foo ();
  [t.c : 0] D.1387 = 0;
  return D.1387;

}


And the assembly output:

main:
.LFB3:
        .loc 1 4 0
        pushq   %rbp
.LCFI2:
        movq    %rsp, %rbp
.LCFI3:
        .loc 1 5 0
        call    foo
        movl    $0, %eax
        .loc 1 6 0
        leave
        ret
.LFE3:


Gr.
Steven


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]