OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: Problems with 2.2.10 on HP-UX 11.23/IA

From: Albert Chin (postfix-usersmlists.thewrittenword.com)
Date: Tue May 16 2006 - 10:42:20 CDT


On Tue, May 16, 2006 at 10:21:50AM -0400, Victor Duchovni wrote:
>
> Likely "long double" is not actually 16 byte aligned, but __float80 is.

Consider these two programs:
  $ cat a.c
#include <stdio.h>
#include <setjmp.h>
  
char __char__;
__float80 __float80__;
  
int
main (void) {
  printf ("char address: %lx\n", &__char__);
  printf ("sizeof(__float80): %ld\n", sizeof (__float80__));
  printf ("__float80 address: %lx\n", &__float80__);
}

  $ cat b.c
#include <stdio.h>
#include <setjmp.h>

char __char__;
long double __longdouble__;

int
main (void) {
  printf ("char address: %lx\n", &__char__);
  printf ("sizeof(long double): %ld\n", sizeof (__longdouble__));
  printf ("long double address: %lx\n", &__longdouble__);
}

$ cc -S a.c
$ cc -S b.c
[remove comments from a.s and b.s]

$ gnudiff -u a.s b.s
-10,9 +10,9
        .type __char__,object
        .global __char__
        .acomm __char__, 1, 1
- .type __float80__,object
- .global __float80__
- .acomm __float80__, 16, 16
+ .type __longdouble__,object
+ .global __longdouble__
+ .acomm __longdouble__, 16, 16
        .size main, 352
 // Routine [id=0004] ( main )

-143,9 +143,9
 .abe$__undef00001: stringz "char address: %lx\n"
        data1 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
        data1 0x00, 0x00, 0x00, 0x00, 0x00
-.abe$__undef00002: stringz "sizeof(__float80): %ld\n"
- data1 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-.abe$__undef00003: stringz "__float80 address: %lx\n"
+.abe$__undef00002: stringz "sizeof(long double): %ld\n"
+ data1 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+.abe$__undef00003: stringz "long double address: %lx\n"

 // ===
        .secalias .abe$6.HP.opt_annot, ".HP.opt_annot"

I don't know IA64 assembly but there doesn't seem to be much
difference in the resulting assembly code. I just cannot figure out
why __float80 works for ALIGN_TYPE. I've pinged the HP developers
mailing list trying to find out why.

--
albert chin (chinathewrittenword.com)