Subject: kern/22933: Probable pointer alias bug in kern_timeout.c
To: None <gnats-bugs@gnats.netbsd.org>
From: None <scw@netbsd.org>
List: netbsd-bugs
Date: 09/24/2003 16:42:04
>Number:         22933
>Category:       kern
>Synopsis:       gcc3 miscompiles kern_timeout.c with -O2 on ARM
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 24 15:43:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 1.6ZC
>Organization:
>Environment:
System: NetBSD verde 1.6ZC NetBSD 1.6ZC (IQ80321) #34: Wed Sep 24 16:13:59 BST 2003 steve@loser:/u1/netbsd/usr/src/sys/arch/evbarm/compile/IQ80321 evbarm
Architecture: arm
Machine: evbarm
>Description:
It looks like there is a pointer aliasing issue in sys/kern/kern_timeout.c
when compiled by gcc3, targetting ARM/Xscale cpus (although it is possible
some other as yet untested cpus are affected too).

With the default kernel build settings (-O2), TCP and NFS re-transmit
timeouts do not happen.
>How-To-Repeat:
Try to run a gcc3-built -current kernel on an Xscale platform.
Observe failure of TCP and NFS re-transmits (and probably other stuff).

Re-compile kern_timeout.c with DEFOPTS="-O2 -fno-strict-aliasing" to
make everything happy again.
>Fix:
Not known.
>Release-Note:
>Audit-Trail:
>Unformatted: