This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Compiler bug (arm-elf-gcc)?


I experienced  a strange problem in the file hal_misc.c (hal\arm\arch),
function
cyg_hal_invoke_constructors.
The following loop
    for (p = &__CTOR_END__[-1]; p >= __CTOR_LIST__; p--)
        (*p) ();
causes a never-ending loop because the pointer p is never decremented.

I changed it as follows
    for (p = &__CTOR_END__[-1]; p >= __CTOR_LIST__; )
   {
        (*p) ();
        p--;
   }
and now its behavior is correct.

It it really a compiler bug (arm-elf-gcc 2.95.2)?

Thanks in advance.

llandre


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]