|
|
|
|
|
|
|
|
|
|
xen-ia64-devel
Re: [Xen-ia64-devel] [PATCH][GFW] fix unalignment ref with gcc 4.x
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
|
|
|
|
|