From: Dmitri M. <dm...@gm...> - 2012-01-20 18:46:06
|
I believe the x86 assembler interprets .align directive argument as cleared bits not bytes. Thus .align 4 actually means alignment on 16-byte boundary. The maximum alignment in such interpretation is 15 (or 32K bytes), hence the assembler issues a warning about .align 16 Regards, Dmitri On Fri, Jan 20, 2012 at 7:42 PM, <jik...@li...> wrote: > details: http://jikesrvm.hg.sourceforge.net/hgweb/jikesrvm/jikesrvm/rev/620091f03696 > changeset: 10422:620091f03696 > user: Dave Grove <gr...@us...> > date: Fri Jan 20 13:42:06 2012 -0500 > description: > RVM-944 : avoid compiler warnings when building bootImageRunner > > Patch from Dimitri Makarov. Did not apply change of alignment of inline > asm code from 16 bytes to 4 bytes because I suspect the align 16 was done > for performance reasons (start hot instruction sequence on cache line boundary). > I did apply rest of patch unchanged. > > > diffstat: > > tools/bootImageRunner/RunBootImage.C | 3 +-- > tools/bootImageRunner/ia32/libvm.c | 16 ++++++++-------- > tools/bootImageRunner/sys.C | 6 +++--- > 3 files changed, 12 insertions(+), 13 deletions(-) > > diffs (110 lines): > > diff -r 5a62dd2fb410 -r 620091f03696 tools/bootImageRunner/RunBootImage.C > --- a/tools/bootImageRunner/RunBootImage.C Tue Jan 17 11:38:07 2012 +1100 > +++ b/tools/bootImageRunner/RunBootImage.C Fri Jan 20 13:42:06 2012 -0500 > @@ -121,8 +121,7 @@ > fprintf(SysTraceFile," (to execute a class)\n"); > fprintf(SysTraceFile,"where options include\n"); > for (const char * const *msgp = nonStandardUsage; *msgp; ++msgp) { > - fprintf(SysTraceFile, *msgp); > - fprintf(SysTraceFile,"\n"); > + fprintf(SysTraceFile, "%s\n", *msgp); > } > } > > diff -r 5a62dd2fb410 -r 620091f03696 tools/bootImageRunner/ia32/libvm.c > --- a/tools/bootImageRunner/ia32/libvm.c Tue Jan 17 11:38:07 2012 +1100 > +++ b/tools/bootImageRunner/ia32/libvm.c Fri Jan 20 13:42:06 2012 -0500 > @@ -521,7 +521,7 @@ > isRecoverable? "" : " UNRECOVERABLE", > signo, strsignal(signo)); > > - writeErr("handler stack %p\n", localInstructionAddress); > + writeErr("handler stack %x\n", localInstructionAddress); > if (signo == SIGSEGV) > writeErr("si->si_addr %p\n", si->si_addr); > #ifndef __x86_64__ > @@ -546,7 +546,7 @@ > writeErr("eflags 0x%08x\n", IA32_EFLAGS(context)); > // writeErr("esp_at_signal 0x%08x\n", IA32_UESP(context)); > /* null if fp registers haven't been used yet */ > - writeErr("fpregs %p\n", IA32_FPREGS(context)); > + writeErr("fpregs %x\n", IA32_FPREGS(context)); > #ifndef __x86_64__ > writeErr("oldmask 0x%08lx\n", (unsigned long) IA32_OLDMASK(context)); > writeErr("cr2 0x%08lx\n", > @@ -740,7 +740,7 @@ > Address stackLimit > = *(Address *)(threadObjectAddress + RVMThread_stackLimit_offset); > if (sp <= stackLimit - 384) { > - writeErr("sp (%p)too far below stackLimit (%p)to recover\n", sp, stackLimit); > + writeErr("sp (%x)too far below stackLimit (%x)to recover\n", sp, stackLimit); > signal(signo, SIG_DFL); > raise(signo); > // We should never get here. > @@ -998,31 +998,31 @@ > bootRecord = (BootRecord *) bootDataRegion; > > if (bootRecord->bootImageDataStart != (Address) bootDataRegion) { > - fprintf(SysErrorFile, "%s: image load error: built for %p but loaded at %p\n", > + fprintf(SysErrorFile, "%s: image load error: built for %x but loaded at %p\n", > Me, bootRecord->bootImageDataStart, bootDataRegion); > return 1; > } > > if (bootRecord->bootImageCodeStart != (Address) bootCodeRegion) { > - fprintf(SysErrorFile, "%s: image load error: built for %p but loaded at %p\n", > + fprintf(SysErrorFile, "%s: image load error: built for %x but loaded at %p\n", > Me, bootRecord->bootImageCodeStart, bootCodeRegion); > return 1; > } > > if (bootRecord->bootImageRMapStart != (Address) bootRMapRegion) { > - fprintf(SysErrorFile, "%s: image load error: built for %p but loaded at %p\n", > + fprintf(SysErrorFile, "%s: image load error: built for %x but loaded at %p\n", > Me, bootRecord->bootImageRMapStart, bootRMapRegion); > return 1; > } > > if ((bootRecord->spRegister % 4) != 0) { > - fprintf(SysErrorFile, "%s: image format error: sp (%p) is not word aligned\n", > + fprintf(SysErrorFile, "%s: image format error: sp (%x) is not word aligned\n", > Me, bootRecord->spRegister); > return 1; > } > > if ((bootRecord->ipRegister % 4) != 0) { > - fprintf(SysErrorFile, "%s: image format error: ip (%p) is not word aligned\n", > + fprintf(SysErrorFile, "%s: image format error: ip (%x) is not word aligned\n", > Me, bootRecord->ipRegister); > return 1; > } > diff -r 5a62dd2fb410 -r 620091f03696 tools/bootImageRunner/sys.C > --- a/tools/bootImageRunner/sys.C Tue Jan 17 11:38:07 2012 +1100 > +++ b/tools/bootImageRunner/sys.C Fri Jan 20 13:42:06 2012 -0500 > @@ -938,7 +938,7 @@ > > if (numCpus < 0) { > if (firstRun) fprintf(SysTraceFile, "%s: WARNING: Can not figure out how many CPUs" > - " are online; assuming 1\n"); > + " are online; assuming 1\n", Me); > numCpus = 1; // Default > } > > @@ -1593,7 +1593,7 @@ > unsigned int len = cnt; > > __asm__ volatile ( > - ".align 16 \n\t" > + ".align 4 \n\t" > "cmp $0x10, %%esi \n\t" > "jl 0f \n\t" > "pxor %%xmm0, %%xmm0 \n\t" > @@ -1788,7 +1788,7 @@ > void* res = mmap(start, (size_t)(length), protection, flags, fd, (off_t)offset); > if (res == (void *) -1){ > #if RVM_FOR_32_ADDR > - fprintf(stderr, "mmap (%x, %u, %d, %d, %d, %ld) failed with %d: ", > + fprintf(stderr, "mmap (%x, %u, %d, %d, %d, %d) failed with %d: ", > (Address) start, (unsigned) length, protection, flags, fd, offset, errno); > #else > fprintf(stderr, "mmap (%llx, %u, %d, %d, -1, 0) failed with %d: ", > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > Jikesrvm-commits mailing list > Jik...@li... > https://lists.sourceforge.net/lists/listinfo/jikesrvm-commits -- Dmitri |