Optimization issue in RISC-V BSP

Denis Obrezkov denisobrezkov at gmail.com
Thu Jul 27 23:43:45 UTC 2017


I didn't want to enable optimization because I was afraid of new mistakes.
So, I enabled -Os and now I have:
_Terminate (the_source=the_source at entry=INTERNAL_ERROR_CORE,
the_error=the_error at entry=3)
    at
/home/reprofy/Projects/riscv/rtems/development/rtems/kernel/rtems-riscv/c/src/../../cpukit/score/src/interr.c:44
44        _CPU_Fatal_halt( the_source, the_error );
(gdb) i s
#0  _Terminate (the_source=the_source at entry=INTERNAL_ERROR_CORE,
the_error=the_error at entry=3)
    at
/home/reprofy/Projects/riscv/rtems/development/rtems/kernel/rtems-riscv/c/src/../../cpukit/score/src/interr.c:44
#1  0x20401672 in _Internal_error (core_error=core_error at entry
=INTERNAL_ERROR_WORKSPACE_ALLOCATION)
    at
/home/reprofy/Projects/riscv/rtems/development/rtems/kernel/rtems-riscv/c/src/../../cpukit/score/src/interr.c:51
#2  0x20404968 in _Workspace_Allocate_or_fatal_error (size=<optimized out>)
at ../../cpukit/../../../hifive1/lib/include/rtems/score/heapimpl.h:137
#3  0x20401f76 in _Objects_Extend_information (information=0x80000ad4
<_RTEMS_tasks_Information>)
    at
/home/reprofy/Projects/riscv/rtems/development/rtems/kernel/rtems-riscv/c/src/../../cpukit/score/src/objectextendinformation.c:70
#4  0x20402110 in _Objects_Do_initialize_information
(information=information at entry=0x80000ad4 <_RTEMS_tasks_Information>,
the_api=the_api at entry=OBJECTS_CLASSIC_API,
    the_class=<optimized out>, maximum=maximum at entry=124, size=<optimized
out>, is_string=<optimized out>,
maximum_name_length=maximum_name_length at entry=4)
    at
/home/reprofy/Projects/riscv/rtems/development/rtems/kernel/rtems-riscv/c/src/../../cpukit/score/src/objectinitializeinformation.c:118
#5  0x20402e3a in _Thread_Initialize_information
(information=information at entry=0x80000ad4 <_RTEMS_tasks_Information>,
the_api=the_api at entry=OBJECTS_CLASSIC_API,
    the_class=the_class at entry=1, maximum=124, is_string=is_string at entry=false,
maximum_name_length=maximum_name_length at entry=4)
    at
/home/reprofy/Projects/riscv/rtems/development/rtems/kernel/rtems-riscv/c/src/../../cpukit/score/src/thread.c:57
#6  0x20400ff8 in _RTEMS_tasks_Manager_initialization () at
/home/reprofy/Projects/riscv/rtems/development/rtems/kernel/rtems-riscv/c/src/../../cpukit/rtems/src/tasks.c:72
#7  0x2040112e in rtems_initialize_executive () at
/home/reprofy/Projects/riscv/rtems/development/rtems/kernel/rtems-riscv/c/src/../../cpukit/sapi/src/exinit.c:92
#8  0x20400496 in boot_card (cmdline=<optimized out>) at
/home/reprofy/Projects/riscv/rtems/development/rtems/kernel/rtems-riscv/c/src/lib/libbsp/riscv32/hifive1/../../shared/bootcard.c:78

Though, the size of executable is much lower (almost two times),
but I get this mistake. And as for now I can't understand do I have the
error
due to optimization or has the optimization revealed another issue?

-- 
Regards, Denis Obrezkov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20170728/0c9ddf7c/attachment-0001.html>


More information about the devel mailing list