Subject: port-alpha/7676: assigning HUGE_VAL to a double causes an unaligned access
To: None <gnats-bugs@gnats.netbsd.org>
From: Dave Huang <khym@bga.com>
List: netbsd-bugs
Date: 05/31/1999 03:20:54
>Number:         7676
>Category:       port-alpha
>Synopsis:       assigning HUGE_VAL to a double causes an unaligned access
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-alpha-maintainer (NetBSD/alpha Portmaster)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 31 03:20:01 1999
>Last-Modified:
>Originator:     Dave Huang
>Organization:
	
>Release:        NetBSD-current as of May 30, 1999
>Environment:
System: NetBSD yerfable.metonymy.com 1.4C NetBSD 1.4C (YERFABLE) #0: Mon May 31 03:50:42 CDT 1999 khym@yerfable.metonymy.com:/mnt/src/sys/arch/alpha/compile/YERFABLE alpha

NetBSD 1.4 libraries and userland

>Description:
	Assigning HUGE_VAL from /usr/include/math.h to a variable of type
double causes an unaligned access error/warning.
>How-To-Repeat:

% cat testing.c
#include <math.h>

int main(void)
{
  double d = HUGE_VAL;
  return 0;
}

% ./testing
pid 848 (testing): unaligned access: va=0x1602aa16c pc=0x120000afc ra=0x120000760 op=ldt
>Fix:
	Don't know, but all that casting around certainly looks problematic
to me :)

extern const char __infinity[];
#define HUGE_VAL        (*(const double *)(const void *)__infinity)
>Audit-Trail:
>Unformatted: