Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

GCC Patches

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.
No RepliesBe the first to reply