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++

GCC Patches

Altera_Forum
Honored Contributor II
1,169 Views

I've put 4 patches for gcc onto the wiki. 

They should apply to both the 9.0 (build 141) and 9.1 (build 222) gcc source trees. 

 

They improve the generated code for: 

 

1) Constants that can be loaded with 'movhi'. 

 

2) Accessing structures in the 'small' data area - ie using %gprel(structure+offset)(gp) instead of setting another register to point to the structure start. 

 

By default only items of 1-4 bytes end up in the 'small' data area. Other items can be forced to have %gprel addressing by placing them in the .sdata, .sbss, .sdata.* or .sbss.* sections using (eg) __attribute((section(".sbss"))). 

 

For small systems is makes sense to get the ldscript to put almost all memory (and some memory mapped io) within the range of _gp.
0 Kudos
0 Replies
Reply