WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

Re: [Xen-ia64-devel] [PATCH][GFW] fix unalignment ref with gcc 4.x

To: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Subject: Re: [Xen-ia64-devel] [PATCH][GFW] fix unalignment ref with gcc 4.x
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Mon, 15 Oct 2007 18:12:00 +0900
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 15 Oct 2007 02:12:29 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <7k1wbwkb1s.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <7k1wbwkb1s.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
Hi.

gcc doesn't support aligned attribute for values on stack.
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16660

To be honest, I'm not sure about latest one.
At least my ia64-unknown-linux-gcc 4.1.2 which I compiled from
the source code doesn't.

Is your gcc the RedHat patched one?
Did you check the resulted assembler code?

On Mon, Oct 15, 2007 at 05:59:59PM +0900, Kouya Shimura wrote:
Content-Description: message body text
> Hi Tristan,
> 
> The attached patch fix unalignment reference with gcc 4.x.
> I tested the binary built with gcc 4.1.1 works fine.
> 
> Thanks,
> Kouya
> 
> Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
> 

> diff -r 8ecccd88813c edk2-sparse/EdkXenPkg/Cpu/Itanium/Timer/Dxe/Timer.c
> --- a/edk2-sparse/EdkXenPkg/Cpu/Itanium/Timer/Dxe/Timer.c     Thu Oct 11 
> 02:09:46 2007 +0200
> +++ b/edk2-sparse/EdkXenPkg/Cpu/Itanium/Timer/Dxe/Timer.c     Mon Oct 15 
> 15:50:46 2007 +0900
> @@ -421,15 +421,15 @@ VOID
>  VOID
>  check_regs (VOID)
>  {
> -     long save[SAVESZ / 8];
> -     long rand[RANDSZ / 8];
> +     long save[SAVESZ / 8] __attribute__ ((aligned (16)));
> +     long rand[RANDSZ / 8] __attribute__ ((aligned (16)));
>       long *r;
>       int     i;
>  
>       for (i = 0; i < RANDSZ; i++)
>         ((unsigned char*)rand)[i] = i ^ 0x59;
>  
> -     if (r = regcheck(save, rand)) {
> +     if ((r = regcheck(save, rand))) {
>         int reg = r - rand;
>         asm volatile ("rsm psr.ic;; mov r2=%0; break 4" : : "r"(reg));
>  #if 0

> _______________________________________________
> Xen-ia64-devel mailing list
> Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-ia64-devel

-- 
yamahata

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel