EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  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  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: PPC compiler splits up ints & shorts?
From: "Lawrence T. Hoff" <[email protected]>
To: "'Laznovsky, Michael'" <[email protected]>, <[email protected]>
Date: Wed, 29 Sep 2004 05:57:53 -0400
	Among other things, -mstrict-align prevents the compiler 
from using a (64-bit) floating point register to store a 64-bit
integer structure. If the compiler uses a FP register for 
integer data, it can result in unpredictable results when
context switching to/from tasks which are not designated as FP
tasks in VxWorks. If your O/S does not distinguish between FP
and non-FP tasks, then this issue is moot. An example of a 64-bit
integer data structure is the time data structure used in the
function "select". 

	I.e. this code is vulnerable if compiled without -mstrict-align,
and used in VxWorks as a non-FP task:

for(;;){

     struct timeval oneSecond = { 1, 0 };

     select(1, NULL, NULL, NULL, &oneSecond);

     doOneSecondTask();

     }

	If the compiler chooses to store "oneSecond" in a FP register
for convenience, the contents can get "clobbered" by a true FP task
using that register for FP purposes, because VxWorks will not restore
FP registers when switching back to this non-FP task.

	Bottom line : I recommend continuing to compile with
-mstrict-align
or configuring *all* "spawned" tasks as FP.

HTH -- Larry


References:
RE: PPC compiler splits up ints & shorts? Laznovsky, Michael

Navigate by Date:
Prev: RE: PPC compiler splits up ints & shorts? Lawrence T. Hoff
Next: Re: Forcing a record to be processed Ralph Lange
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: PPC compiler splits up ints & shorts? Laznovsky, Michael
Next: RE: PPC compiler splits up ints & shorts? Laznovsky, Michael
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·