lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:	Sat, 24 Mar 2007 20:31:18 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	"yuan cooper" <yuanxjtu@...mail.com>
Cc:	linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
	dmitry.torokhov@...il.com
Subject: Re: About GCC4 Optimization

On Sun, 25 Mar 2007 03:42:25 +0000 "yuan cooper" <yuanxjtu@...mail.com> wrote:

> Hi all:
>  
> during my work, I found there is a bug with GCC4 O2 optimization.
>  
> ---------------------
> float ftmp;
> unsigned long tmp;
> ftmp = 1.0/1024.0;
> tmp  = *(unsigned long *)(&ftmp);
> tmp  = (tmp >> 11) && 0xFFF;
> --------------------- 
>  
> if optimization level is O2, gcc will MOV eax to tmp, but current eax has a random value.
> -O is ok and gcc3 with O2 is ok too.
>  
>  
> I am a kernel newbie, I don't know how to make contributions to janitors, who will help me? It's my first post, any suggestion will be appreciated.

Don't use floating point in kernel code.  At all.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ