This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

issues with doubles and -fno-schedule-insns2


Hi

i have a C code snipit that causes problems with gcc 3.3.4 and 3.4.1, i have 
not tried the v4 snapshots, in all cases are am hosted and targeting on i386.

void test(void)
{	
	unsigned int Value[2] = { 0x7FF00000, 0x7FF00000 };
	double *ValueD = (double *)&Value[0];
	
	// (*ValueD) should be "nan"
}

i've did some elimination and got the following results, seems 
-fno-schedule-insns2 is breaking things.

// gcc-3.3.4 -O3 -fno-schedule-insns2 (works)
// gcc-3.3.4 -O3 (fail) '(*ValueD) = 2.15833'
// gcc-3.3.4 -O2 -fno-schedule-insns2 (works)
// gcc-3.3.4 -O2 (fail) '(*ValueD) = 2.15833'
// gcc-3.3.4 -O1 (works)
// gcc-3.3.4 -O0 (works)

// gcc-3.4.1 -O3 -fno-schedule-insns2 (works)
// gcc-3.4.1 -O3 (fail) '(*ValueD) = 2.122e-314'
// gcc-3.4.1 -O2 -fno-schedule-insns2 (works)
// gcc-3.4.1 -O2 (fail) '(*ValueD) = 2.122e-314'
// gcc-3.4.1 -O1 (works)
// gcc-3.4.1 -O0 (works)


a small modification to the code to,..

unsigned int Value[2] = { 0x7FF00000, 0x7FF00000 };

void test(void)
{	
	double *ValueD = (double *)&Value[0];
	
	// (*ValueD) should be "nan"
}

and all the above compiler combinations work.

am i doing something wrong ?

regards
---
Matthew J Fletcher
Embedded Software
Serck Controls Ltd
---
**********************************************************************
Serck Controls Ltd, Rowley Drive, Coventry, CV3 4FH, UK
Tel: +44 (0) 24 7630 5050   Fax: +44 (0) 24 7630 2437
Web: www.serck-controls.com  Admin: post@serck-controls.co.uk
A subsidiary of Serck Controls Pty. Ltd. Reg. in England No. 4353634
**********************************************************************
This email and files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the above. Any views or opinions presented are those of the author
and do not necessarily represent those of Serck Controls Ltd.


This message has been checked by MessageLabs
******************************************************************


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]