[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gcl-devel] Re: [Gcl-commits] gcl/cmpnew cmpmain.lsp

From: Mike Thomas
Subject: Re: [Gcl-devel] Re: [Gcl-commits] gcl/cmpnew cmpmain.lsp
Date: Thu, 25 Jul 2002 11:08:50 +1000

Hi there.

> 1) Are these compiler flags portable to different
>    compilers/assemblers?

In general I suppose you can't count on it:

>  Specifically solaris?

Using this test file:

int sumit (int a, int b)
 return (a + b );

on Sparc Solaris with "cc -S -c t.c" produces a pile of junk including the
following extract:

! File t.c:
!    1  int sumit (int a, int b)
!    2  {
!    3   return (a + b );

        ld      [%fp+68],%l0
        ld      [%fp+72],%l1
        add     %l0,%l1,%l0
        st      %l0,[%fp-4]
        ba      .L13

        ! block 2
        ba      .L13

        ! block 3
        ld      [%fp-4],%l0
        mov     %l0,%i0
        jmp     %i7+8
        .size   sumit,(.-sumit)
        .align  8

This isn't really a dissassembly, but in theory you can pass -S to the
assembler for a dissassembler using "-Wa,-S" and it amounts to the same
thing I would expect - I just couldn't get this to work when I tried it

> 2) Having biased myself by getting accustomized to objdump output, I'd
>    likt to hear what people think the advantages are of this output
>    vis a vis objdump.  The obvious one is the interleaving of the C
>    source.  But I wanted to know if people think relying on objedump
>    in general is a problem.  Isn't it (at least) as widely available
>    as the availability of the compiler flag combo used below?

Gcc is usually distributed with objdump so this is probably true.  Objdump
doesn't seem to be present on the Solaris machine I did the above test on

The other advantage is that it reduces the problem down to just one
sub-process call plus some LISP filter code.

All-in-all, the interleaving is the only real advantage from my perspective.

> 3) We still need some kind of option to disassemble to turn on or off
>    the -g, and restructure the output accordingly, I'd think.

Agreed.  As mentioned in some overenthusiastic four-in-the-morning email a
week ago, I'll be happy to look at this once I extract myself from the BFD
and ANSI quagmire, if no-one else wants to do it, and we are agreed it is a
good move overall.


Mike Thomas.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]