2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 <2017> 2018 2019 2020 2021 2022 2023 2024 | Index | 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 <2017> 2018 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Add optimization switch to compiler dependencies |
From: | Ralph Lange <[email protected]> |
To: | "Johnson, Andrew N." <[email protected]> |
Cc: | EPICS Core Talk <[email protected]> |
Date: | Mon, 21 Aug 2017 17:18:08 +0200 |
void myTestFunction(void) EPICS_OPTIMIZATION_OFF{}
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 <[email protected]> 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
>