[ECOS] Re: issue with floor()

Sergei Gavrikov sergei.gavrikov@gmail.com
Wed Nov 10 19:16:00 GMT 2010


On Wed, 10 Nov 2010, Grant Edwards wrote:

> On 2010-11-10, David Brennan <david@brennanhome.com> wrote:
>
>> [...]
>> So it looks like this may actually be an eCos source code problem. I
>> can take a stab at fixing this. But if anyone happens to know right
>> away how to do it, I'd welcome the help. This code is not the most
>> straight forward.
>> [...]
>
> Yep. Things like this are bound to happen when compiler warnings are
> ignored.
>
>> the option -fno-strict-aliasing can be used as a work-around.
>
> Well, I'd try adding -fno-stric-aliasing to the compile options for
> the relevent packages.
>
> If that fixes it, then you've confirmed the source of the problem, and
> the next step is to decide whether to try fixing the libm code or not.

Hi,

It was surprise for me that cdl_option CYGPKG_LIBM_CFLAGS_ADD are not
evaluated properly:

   CVS libm.cdl:
   cdl_option CYGPKG_LIBM_CFLAGS_ADD {
       display "Additional compiler flags"
       flavor  data
       no_define
       default_value { "-fno-strict-aliasing " . \
                           ((0 == CYGPKG_HAL_I386) && (0 == CYGPKG_HAL_SYNTH_I386)) ? "" : "-ffloat-store" }
       description   "
           This option modifies the set of compiler flags for
           building the math library. These flags are used in addition
           to the set of global flags."
   }

What I expected to get then? That _would_ be either

   "-fno-strict-aliasing " or  "-fno-strict-aliasing -ffloat-store"

Right?

But final value for LIBM_CFLAGS_ADD is *always*  "" (empty string).

Try, please:

   % ecosconfig new {pc,linux,pid}
   % less -p 'LIBM_CFLAGS_ADD ' ecos.ecc

CDL concatenation does not work as I would expect. It seems for me
that in the expession are missed parentheses.

The below works as I could expect

         default_value { "-fno-strict-aliasing " . \
                             (((0 == CYGPKG_HAL_I386) && (0 == CYGPKG_HAL_SYNTH_I386)) ? "" : "-ffloat-store") }

Can anybody confirm this?

RFC:

Why is it used comparisons the 0s with CDL 'booldata' in the expression?
What is about (!CYGPKG_A && !CYGPKG_B) there?

Thank you,

Sergei

PS

BTW, I became to observe `libm.cdl' after a reading this chapter:
http://ecos.sourceware.org/docs-latest/cdl-guide/build.make.html

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list