Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: David B Anderson <davea@quasar.engr.sgi.com>
To: David B Anderson <davea@quasar.engr.sgi.com>,
	Andrew Cagney   <ac131313@cygnus.com>
Cc: gdb-patches@sources.redhat.com, drow@mvista.com
Subject: Re: [rfa] mips argument passing fixes for o32
Date: Tue, 17 Jul 2001 07:49:00 -0000	[thread overview]
Message-ID: <200107171447.HAA66261@quasar.engr.sgi.com> (raw)
In-Reply-To: <200107160328.UAA42806@quasar.engr.sgi.com>

>
>The debate os over a possible exception to this rule.  Given a very 
>small structure and the code segment:
>
>        struct c1 { char c; } s1;
>        foo (struct c1);
>        ...
>        foo (s1);
>
>GCC is always left shifting s1 in a register (regardless of -EL or EB).


Well.... 
proton 25% cc -c -32 t3.c -show
/usr/lib/cc -DEFAULT:abi=n32:isa=mips4:proc=r10k -c -32 t3.c -show
/usr/lib/cfe -D_MIPS_FPSET=16 -D_MIPS_ISA=2 -D_ABIO32=1 -D_MIPS_SIM=_ABIO32 -D_MIPS_SZINT=32 -D_MIPS_SZLONG=32 -D_MIPS_SZPTR=32 -D_SIZE_INT=32 -D_SIZE_LONG=32 -D_SIZE_PTR=32 -D__EXTENSIONS__ -DLANGUAGE_C -D_LANGUAGE_C -D__INLINE_INTRINSICS -Dsgi -D__sgi -Dunix -Dmips -Dhost_mips -D__unix -D__host_mips -D_SVR4_SOURCE -D_MODERN_C -D_SGI_SOURCE -D_PIC -D__DSO__ -DSYSTYPE_SVR4 -D_SYSTYPE_SVR4 -D_LONGLONG -D__mips=2 -I -D_MIPSEB -DMIPSEB -D__STDC__=1 -I/usr/include t3.c -Xv -D_CFE -Amachine(mips) -Asystem(unix) -call_shared -G 0 -std -XS/tmp/ctmsta000Ss -mips2 -EB -Xg0 -O1 > /tmp/ctmfa000Ss 
cfe: main /usr/lib/ugen -v -G 0 -pic2 -mips2 -EB -g0 -O1 /tmp/ctmfa000Ss -o /tmp/ctmca000Ss -t /tmp/ctmsta000Ss -temp /tmp/ctmgta000Ss 
ugen: main
/usr/lib/as1 -t5_ll_sc_bug -elf -pic2 -v -G 0 -p0 -mips2 -EB -g0 -O1 /tmp/ctmca000Ss -o t3.o -t /tmp/ctmsta000Ss 
as1: main 
proton 26% dis t3.o
                ****   DISASSEMBLER  ****


disassembly for t3.o

section .text
main:
[   7] 0x   0:  3c 1c 00 00    lui gp,0
[   7] 0x   4:  27 9c 00 00    addiu gp,gp,0
[   7] 0x   8:  03 99 e0 21    addu gp,gp,t9
[   8] 0x   c:  8f 8e 00 00    lw t2,0(gp)
[   8] 0x  10:  8f 99 00 00    lw t9,0(gp)
[   7] 0x  14:  27 bd ff e0    addiu sp,sp,-32
[   8] 0x  18:  91 ce 00 00    lbu t2,0(t2)
[   7] 0x  1c:  af bf 00 1c    sw ra,28(sp)
[   7] 0x  20:  af bc 00 18    sw gp,24(sp)
[   8] 0x  24:  a3 ae 00 00    sb t2,0(sp)
[   8] 0x  28:  03 20 f8 09    jalr t9
[   8] 0x  2c:  8f a4 00 00    lw a0,0(sp)
[   9] 0x  30:  8f bf 00 1c    lw ra,28(sp)
[   8] 0x  34:  8f bc 00 18    lw gp,24(sp)
[   9] 0x  38:  27 bd 00 20    addiu sp,sp,32
[   9] 0x  3c:  03 e0 00 08    jr ra
[   9] 0x  40:  00 00 10 25    move v0,zero
[   9] 0x  44:  00 00 00 00    nop
[   9] 0x  48:  00 00 00 00    nop
[   9] 0x  4c:  00 00 00 00    nop
proton 27% cat t3.c

struct c1 { char c; } s1;

int foo (struct c1);

int main()
{
        foo (s1);
        return 0;
}

And -EL seems to generate the same instructions (but I don't quite
trust -EL).

Regards,
David B. Anderson davea@sgi.com danderson@acm.org 
< http://reality.sgi.com/davea > 
(reality.sgi.com to be permanently turned off --  around Aug 15, 2001)


  parent reply	other threads:[~2001-07-17  7:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-12 17:03 David B Anderson
2001-07-15 14:50 ` Andrew Cagney
2001-07-15 15:22   ` Daniel Jacobowitz
2001-07-16  7:46     ` Andrew Cagney
2001-07-15 20:29 ` David B Anderson
2001-07-16 16:44   ` Andrew Cagney
2001-07-17  7:49   ` David B Anderson [this message]
2001-07-18 13:29     ` Andrew Cagney
  -- strict thread matches above, loose matches on Subject: below --
2001-07-06 11:26 Daniel Jacobowitz
2001-07-06 14:24 ` Andrew Cagney
2001-07-12  0:47 ` Andrew Cagney
2001-07-12 10:35   ` Daniel Jacobowitz
2001-07-12  1:23 ` Andrew Cagney
2001-07-12 10:39   ` Daniel Jacobowitz
2001-07-12 11:59     ` Andrew Cagney
2001-07-12 12:21       ` Daniel Jacobowitz
2001-07-12 12:38         ` Andrew Cagney
     [not found]       ` <3B58AEBE.1000304@cygnus.com>
     [not found]         ` <20010720152547.A10028@nevyn.them.org>
2001-07-20 16:35           ` Andrew Cagney
2001-07-20 16:46             ` Elena Zannoni
2001-07-23 20:36               ` Andrew Cagney
2001-11-14 14:15         ` Daniel Jacobowitz
2001-11-27  7:48           ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200107171447.HAA66261@quasar.engr.sgi.com \
    --to=davea@quasar.engr.sgi.com \
    --cc=ac131313@cygnus.com \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox