From owner-freebsd-sparc  Tue Dec 22 06:42:07 1998
Return-Path: <owner-freebsd-sparc@FreeBSD.ORG>
Received: (from majordom@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id GAA25243
          for freebsd-sparc-outgoing; Tue, 22 Dec 1998 06:42:07 -0800 (PST)
          (envelope-from owner-freebsd-sparc@FreeBSD.ORG)
Received: from bright.fx.genx.net (bright.fx.genx.net [206.64.4.154])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA25227
          for <freebsd-sparc@FreeBSD.ORG>; Tue, 22 Dec 1998 06:42:02 -0800 (PST)
          (envelope-from bright@hotjobs.com)
Received: from localhost (bright@localhost)
	by bright.fx.genx.net (8.9.1/8.9.1) with ESMTP id JAA53524;
	Tue, 22 Dec 1998 09:45:37 -0500 (EST)
	(envelope-from bright@hotjobs.com)
X-Authentication-Warning: bright.fx.genx.net: bright owned process doing -bs
Date: Tue, 22 Dec 1998 09:45:37 -0500 (EST)
From: Alfred Perlstein <bright@hotjobs.com>
X-Sender: bright@bright.fx.genx.net
To: Paolo Di Francesco <paipai@tin.it>
cc: freebsd-sparc@FreeBSD.ORG
Subject: Re: Cross compiled code
In-Reply-To: <19981222090251.CUQO18112.fep03-svc@winworkstation>
Message-ID: <Pine.BSF.4.05.9812220941370.6331-100000@bright.fx.genx.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-freebsd-sparc@FreeBSD.ORG
Precedence: bulk
X-Loop: FreeBSD.org


Try -fomit-frampointer (or equiv)
%fp offset looks offwhack, but i'm not sure.  the code looks ok and i
commented it for you. (*) means i'm unsure, but i'll check my book on the
way to work.

-Alfred



> Can someone if this code is correct?
> 
> 
> ----- the original program prova.c (c code) -------
> 
> 
> main(){
>  int a,b;
> 
>  a = 10;
>  b = 20 + a;
> }
> 
> --------------------------------------------
> 
> compiled with xgcc -S 
> 
> --------------------------------------------
>  .file	"prova.c"
> .section	".text"
>  .align 4
>  .global main
>  .type	 main,#function
>  .proc	04
> main:
>  !#PROLOGUE# 0
>  save %sp,-208,%sp	! adjust stack fram
>  !#PROLOGUE# 1
>  mov 10,%o0		! a = 10
>  st %o0,[%fp+2027]	! this looks fishy 2027 looks a bit high(*)
>  ld [%fp+2027],%o0	! fishy (*)
>  add %o0,20,%o1	! a + 20 -> 
>  st %o1,[%fp+2023]	! fishy (*)
> .LL1:
>  return %i7+8
>  nop
> .LLfe1:
>  .size	 main,.LLfe1-main
>  .ident	"GCC: (GNU) egcs-2.91.60 19981201 (egcs-1.1.1 release)"
> 
> ---------------------------------------------------------------
> 
> I have linked it and it seems ok.
> 
> P.S. host=Linux-RedHat5.0
> 
> 
> Ciao Ciao
>        Paolo Di Francesco
>    _
>  ->B<-   All Recycled Bytes Message ...
>    ~
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-sparc" in the body of the message
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-sparc" in the body of the message