public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* egcs 1.0.2 VS. gcc 2.7.X on sparc
@ 1998-03-27  4:21 Miklos Szeredi
  1998-03-28 19:24 ` Jeffrey A Law
  0 siblings, 1 reply; 4+ messages in thread
From: Miklos Szeredi @ 1998-03-27  4:21 UTC (permalink / raw)
  To: egcs

Hi!

In the following assemly listing egcs added a superfluous instruction
which an older gcc did not:

egcs:
	ld [%i0+28],%o0
	ldub [%o0],%o0
	lduh [%i0+30],%o1
	and %o0,0xff,%o0        <--- (I guess 'ldub' already does this)
	sll %o0,2,%o0
	ld [%l0+%o0],%o0
	add %o1,1,%o1
	call %o0,0
	sth %o1,[%i0+30]

gcc:
	ld [%i0+28],%o1
	lduh [%i0+30],%o0
	ldub [%o1],%o1
	add %o0,1,%o0
	sth %o0,[%i0+30]
	sll %o1,2,%o1
	ld [%l0+%o1],%o0
	call %o0,0
	nop


Why is this?

Thanks,
Miklos

Header of egcs assmbly listing:

! GNU C version egcs-2.90.27 980315 (egcs-1.0.2 release) (sparc-sun-solaris2.5.1) compiled by GNU C version egcs-2.90.27 980315 (egcs-1.0.2 release).
! options passed:  -O3 -Wall -fomit-frame-pointer -funroll-loops
! options enabled:  -fdefer-pop -fomit-frame-pointer -fcse-follow-jumps
! -fcse-skip-blocks -fexpensive-optimizations -fthread-jumps
! -fstrength-reduce -funroll-loops -fpeephole -fforce-mem -ffunction-cse
! -finline-functions -finline -fkeep-static-consts -fcaller-saves
! -fpcc-struct-return -fdelayed-branch -frerun-cse-after-loop
! -frerun-loop-opt -fschedule-insns -fschedule-insns2 -fcommon
! -fverbose-asm -fgnu-linker -fregmove -falias-check -fargument-alias
! -mepilogue -mapp-regs


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

* Re: egcs 1.0.2 VS. gcc 2.7.X on sparc
  1998-03-27  4:21 egcs 1.0.2 VS. gcc 2.7.X on sparc Miklos Szeredi
@ 1998-03-28 19:24 ` Jeffrey A Law
  1998-03-31  0:46   ` Miklos Szeredi
  0 siblings, 1 reply; 4+ messages in thread
From: Jeffrey A Law @ 1998-03-28 19:24 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: egcs

--
Jeff Law (law@cygnus.com)
Cygnus Solutions		EGCS GNU Compiler System
http://www.cygnus.com		http://www.cygnus.com/egcs

  In message < 199803271124.MAA16476@duna181.danubius >you write:
  > Hi!
  > 
  > In the following assemly listing egcs added a superfluous instruction
  > which an older gcc did not:

Absolutely no way to tell if you don't provide sample code.

jeff

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

* Re: egcs 1.0.2 VS. gcc 2.7.X on sparc
  1998-03-28 19:24 ` Jeffrey A Law
@ 1998-03-31  0:46   ` Miklos Szeredi
  1998-04-03 21:52     ` Jim Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: Miklos Szeredi @ 1998-03-31  0:46 UTC (permalink / raw)
  To: law; +Cc: egcs

>   > Hi!
>   > 
>   > In the following assemly listing egcs added a superfluous instruction
>   > which an older gcc did not:
> 
> Absolutely no way to tell if you don't provide sample code.

OK, I give you a preprocessed stripped down code. The part I'm
interested in is in the do-while loop in the function.

Thanks, 
Miklos

----------------------------------------------------------------------------

> In the following assemly listing egcs added a superfluous instruction
> which an older gcc did not:
> 
> egcs:
> 	ld [%i0+28],%o0
> 	ldub [%o0],%o0
> 	lduh [%i0+30],%o1
> 	and %o0,0xff,%o0        <--- (I guess 'ldub' already does this)
> 	sll %o0,2,%o0
> 	ld [%l0+%o0],%o0
> 	add %o1,1,%o1
> 	call %o0,0
> 	sth %o1,[%i0+30]
> 
> gcc:
> 	ld [%i0+28],%o1
> 	lduh [%i0+30],%o0
> 	ldub [%o1],%o1
> 	add %o0,1,%o0
> 	sth %o0,[%i0+30]
> 	sll %o1,2,%o1
> 	ld [%l0+%o1],%o0
> 	call %o0,0
> 	nop
> 
> 
> Why is this?


> Header of egcs assmbly listing:
> 
> ! GNU C version egcs-2.90.27 980315 (egcs-1.0.2 release) (sparc-sun-solaris2.5.1) compiled by GNU C version egcs-2.90.27 980315 (egcs-1.0.2 release).
> ! options passed:  -O3 -Wall -fomit-frame-pointer -funroll-loops
> ! options enabled:  -fdefer-pop -fomit-frame-pointer -fcse-follow-jumps
> ! -fcse-skip-blocks -fexpensive-optimizations -fthread-jumps
> ! -fstrength-reduce -funroll-loops -fpeephole -fforce-mem -ffunction-cse
> ! -finline-functions -finline -fkeep-static-consts -fcaller-saves
> ! -fpcc-struct-return -fdelayed-branch -frerun-cse-after-loop
> ! -frerun-loop-opt -fschedule-insns -fschedule-insns2 -fcommon
> ! -fverbose-asm -fgnu-linker -fregmove -falias-check -fargument-alias
> ! -mepilogue -mapp-regs

----------------------------------------------------------------------------

typedef unsigned char  byte;
typedef signed   char  sbyte;
typedef unsigned short dbyte;
typedef unsigned int   qbyte;

union dregp {
  struct { byte _b3, _b2, h, l; } s;
  struct { dbyte _d1, d; }        d;
  byte*                           p;
};

typedef struct {
  union dregp nr[9];
  union dregp br[4];
  
  int haltstate;
  int it_mode;
  int iff1, iff2;
  
  byte *mem;

  int tc;
  int rl7;

} Z80;

extern Z80 z80_proc;

typedef void z80t;
typedef z80t (*op_f)(z80t);
extern op_f z80c_op_tab[];

int z80_step(int tc)
{
  z80_proc.tc = tc;
  z80_proc.rl7 = (z80_proc.nr[4].s.l) & 0x80;

  if(z80_proc.haltstate) {
    register int nn;
    nn = (z80_proc.tc - 1) / 4 + 1;
    
    z80_proc.tc -= 4 * nn;
    (z80_proc.nr[4].s.l) += nn;
  }
  else do {
    register byte nextop;

    nextop = * (z80_proc.nr[7].p) ; 
    (z80_proc.nr[7].d.d)++;

    (*z80c_op_tab[nextop])();

    (z80_proc.nr[4].s.l)++; 
  } while(z80_proc.tc > 0);

  (z80_proc.nr[4].s.l) = ((z80_proc.nr[4].s.l) & 0x7F) | z80_proc.rl7;
  return z80_proc.tc;
}

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

* Re: egcs 1.0.2 VS. gcc 2.7.X on sparc
  1998-03-31  0:46   ` Miklos Szeredi
@ 1998-04-03 21:52     ` Jim Wilson
  0 siblings, 0 replies; 4+ messages in thread
From: Jim Wilson @ 1998-04-03 21:52 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: law, egcs

I wasn't able to reproduce this.  I am using the egcs sources from cvs
configured as an irix6-x-solaris2.5.1 cross compiler.  I don't get the
unnecessary and instruction.

Jim

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

end of thread, other threads:[~1998-04-03 21:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-27  4:21 egcs 1.0.2 VS. gcc 2.7.X on sparc Miklos Szeredi
1998-03-28 19:24 ` Jeffrey A Law
1998-03-31  0:46   ` Miklos Szeredi
1998-04-03 21:52     ` Jim Wilson

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).