Specifications

Related Information
Porting to GCC 4.7
For more information about how GNU also provides a porting guide to GCC4.7 to document
common issues.
GCC Releases
For more information about full GCC release notes.
Nios II Specific Changes
Use __buildin_custom_* instead of -mcustom-* or #pragma to reliably generate Nios II Floating
Point Custom Instructions (FPCI), independent of compiler optimization level and command line
flags.
To use -mcustom-* or #pragma for Nios II Floating Point Custom Instructions (FPCI):
The -ffinite-math-only flag must be used to generate fmins and fmax FPCI
The optimization (non -O0 flag) must be used to generate fsqrts FPCI
Users implementing transcendental functions in hardware must use the -funsafe-math-optimiza-
tions flag to generate the FPCI for the transcendental functions fsins(), fcoss(), ftans(),
fatans(), fexps(), flogs() and corresponding double-precision functions.
The Pragma format has changed from eg. #pragma custom_fadds 253 to #pragma GCC
target("custom-fadds=253") and function attributes provide an alternative format
__attribute__((target("custom-fadds=253"))).
Use the -mel/-meb flags instead of -EL/-EB for endian settings. Software Build Tool for Eclipse
(SBTE) users must regenerate the BSP for this setting to take effect.
The -mreverse-bitfields flag and reverse_bitfields pragma are no longer supported.
The -fstack-check flag must be used instead of -mstack-check to enable stack checking.
GCC Changes and Enhancements
The -Wa,-relax-all flag in nios2-elf-gcc GCC 4.7.3 supports function calls and programs
exceeding the 256 MB limit.
When used with optimization, inline assembly code with the asm operator needs to declare values
imported from C and exported back to C, using the mechanisms described on the "Exteded Asm -
Assembler Instructions with C Expression Operands" page.
Pre-standard C++ headers are not supported in GCC 4.7.3. Replace pre-standard C++ with standard C
++ eg. #include <iostream.h>, cout, endl with #include <iostream>, std::cout and
std::endl, respectively.
The compile flag -Wl,--defsym foo=bar where bar is an undefined symbol, will generate error at the
linker level in GCC 4.7.3. GCC 4.1.2 does not include this check.
Related Information
Nios II Software Build Tools on page 4-1
For more information about the GCC toolchains.
Getting Started from the Command Line on page 3-1
Extended Asm - Assembler Instructions with C Expression Operands
Altera Software Installation and Licensing Manual
For more information about installing the Altera Complete Design Suite.
NII5V2
2015.05.14
Nios II Specific Changes
2-35
Getting Started with the Graphical User Interface
Altera Corporation
Send Feedback