EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: compiler bug in gcc version 2.8.1 (Tornado1) for PPC corrupts floationg point constants?
From: "Lawrence T. Hoff" <[email protected]>
To: "'Dirk Zimoch'" <[email protected]>, "'TECHTALK'" <[email protected]>
Date: Tue, 8 Feb 2005 08:00:50 -0500

> -----Original Message-----
> From: Dirk Zimoch [mailto:[email protected]] 
> Sent: Tuesday, February 08, 2005 7:51 AM
> To: TECHTALK
> Subject: compiler bug in gcc version 2.8.1 (Tornado1) for PPC 
> corrupts floationg point constants?
> 
> 
> Hi all,
> 
> I have some driver software that contains
> 
> double scan_period;
> scan_period = 0.05;
> 
> The function is executed from startup script, i.e. the 
> executing task is 
> a floating point task.
> 
> However, sometimes when booting R3.13.2, the ioc crashes with 
> "floating 
> point underflow" while executing
> 
> printf ("init_record_generic: scan_period=%f\n", scan_period);

	Perhaps there is some other task which is doing floating
point operations which is *not* declared as floating point.
Such a task could "step on" the register containing "scan_period".
VxWorks does not restore FP registers when re-scheduling a FP task
unless there has been another FP task scheduled since the previous
FP task had run. I.e. if VxWorks thinks that only non-FP tasks
have run, the FP registers will not be restored, even if they 
have changed for some reason.

	Worse yet, on the PPC, the compiler will (under certain
optimization settings) use the 64-bit FP registers to store
64-bit integer data structures. An example of such data structures
are "struct timeval" and "struct timespec" (each of which consists
of 2 32-bit integer values). 

	If I recall correctly, this optimization is not used if:

	1) All optimization is turned off (-O0)
	2) The -mstrict-align option is used

	You could try recompiling with these options enabled, and/or
ensuring that *all* tasks are FP tasks, and see if the problem goes 
away.

HTH -- Larry


References:
compiler bug in gcc version 2.8.1 (Tornado1) for PPC corrupts floationg point constants? Dirk Zimoch

Navigate by Date:
Prev: compiler bug in gcc version 2.8.1 (Tornado1) for PPC corrupts floationg point constants? Dirk Zimoch
Next: Re: R3.14.7 next build error ?! Ralph Lange
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: compiler bug in gcc version 2.8.1 (Tornado1) for PPC corrupts floationg point constants? Dirk Zimoch
Next: RE: compiler bug in gcc version 2.8.1 (Tornado1) for PPC corrupts floationg point constants? Jeff Hill
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·