Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12627 Discussions

NIOS IORD IOWR -O2 Optimzation Error

Ben12
Beginner
516 Views

I have a problem with a NIOS II design, where code that incorporate IORD() and IOWR() no longer  function correctly, when gcc is used with the -O2 compiler optimization.

I can work around the problem by wrapping my functions with #pragma calls, as shown below.

#pragma GCC push_options
#pragma GCC optimize ("O0")
 
my_function1()
 
#pragma GCC pop_options
 
#pragma GCC push_options
#pragma GCC optimize ("O0")
 
my_function2()
 
#pragma GCC pop_options
 
 
My questions are the following:
 
(1) Is this a known problem with GCC -O2 optimizations with the NIOS II processor's IORD() and IOWR() functions?
(2) Are there any other method I can use to prevent functional code errors, apart from wrapping my functions in a #pragma call?
0 Kudos
1 Reply
hareesh
Employee
474 Views
0 Kudos
Reply