Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017 Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
<== Date ==> <== Thread ==>

Subject: Re: Add optimization switch to compiler dependencies
From: Ralph Lange <ralph.lange@gmx.de>
To: "Johnson, Andrew N." <anj@aps.anl.gov>
Cc: EPICS Core Talk <core-talk@aps.anl.gov>
Date: Mon, 21 Aug 2017 17:18:08 +0200
Interesting.

I was thinking more about source code and function level granularity, i.e. wrapping a compiler attribute:

void myTestFunction(void) EPICS_OPTIMIZATION_OFF
{}

Cheers,
~Ralph



On Mon, Aug 21, 2017 at 4:17 PM, Johnson, Andrew N. <anj@aps.anl.gov> wrote:
Hi Ralph,

I can't try this myself right now but it might be possible to do that already, using a target specific setting of the HOST_OPT and CROSS_OPT variables. Something like this:

epicsCalc$(OBJ): HOST_OPT=NO
epicsCalc$(OBJ): CROSS_OPT=NO

Note that the target involved is the .o file, not the final executable. Not sure where in the Makefile that belongs either.

It might be worth looking at combining the two _OPT variables to simplify that, but I don't remember how they get used.

- Andrew

--
Sent from my iPad

> On Aug 21, 2017, at 6:45 AM, Ralph Lange <ralph.lange@gmx.de> wrote:
>
> Short question:
>
> Would it be worthwhile to add a keyword to the EPICS compiler dependent definitions stuff in libCom/osi that switches off optimization for a function?
>
> Especially for things like test code, implementing tricks to keep the compiler from optimizing away code seems a hopeless struggle against compiler developers.
>
> Cheers,
> ~Ralph
>


References:
Add optimization switch to compiler dependencies Ralph Lange
Re: Add optimization switch to compiler dependencies Johnson, Andrew N.

Navigate by Date:
Prev: Re: Add optimization switch to compiler dependencies Johnson, Andrew N.
Next: Re: RTEMS: rsrv: failed to set mcast loopback in src/ioc/rsrv/caservertask.c Andrew Johnson
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
Navigate by Thread:
Prev: Re: Add optimization switch to compiler dependencies Johnson, Andrew N.
Next: Still can not successful compile/run epicsV4CPP from github Heinz P. Junkes
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
ANJ, 23 Aug 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·