-Wanalyze
-Wanalyze-rule=Rule Number
-Wno-analyze-rule=Rule Number
This option is used for static analysis of code. This option will inspect user application code at build time and offer advice to the user regarding optimization opportunities. The warnings are prompted against following static analysis rules. User can specifically suppress these warnings by using '-Wno'.
Static Analysis Rule 1: Warn whenever an unreachable code is detected. This warning is enabled by `-Wanalyze-rule=1' option.
Static Analysis Rule 2: Warn whenever a local variable or non-constant static variable is unused aside from its declaration. This warning is enabled by `-Wanalyze-rule=2' option.
Static Analysis Rule 3: Warn whenever a static function is declared but not defined or a non-inline static function is unused. This warning is enabled by `-Wanalyze-rule=3' option.
Static Analysis Rule 4: Warn whenever a function parameter is unused aside from its declaration. This warning is enabled by `-Wanalyze-rule=4' option.
Static Analysis Rule 5: Using `++' or `--' within while loop expressions makes it harder to optimize. Warn if such case is encountered. This warning is enabled by `-Wanalyze-rule=5' option.
Static Analysis Rule 6: This option suggests user to use decrementing for loops instead of incrementing for loops. Decrementing loops are faster to execute and also generate less code compared to incrementing loops. This warning is enabled by `-Wanalyze-rule=6' option.
Static Analysis Rule 7: Warn whenever floating point variables are used as loop counters. Floating point arithmetic increases the code size. Also, the inherent nature of the floating point types is such that comparison of equality will often not evaluate to true even if they are expected to. This warning is enabled by `-Wanalyze-rule=7' option.
Static Analysis Rule 8: Warn if automatic variables are not assigned a value before being used. This will reduce the risk of introducing bugs in software owing to unpredictable value of variable. This warning is enabled by `-Wanalyze-rule=8' option.
Static Analysis Rule 9: This option suggests user to declare array size in terms of power of 2. If the array size is a power of 2, an expensive multiply operation will be replaced by an inexpensive shift operation. Thus, keeping array size aligned to a power of 2 will improve performance in array indexing. This warning is enabled by `-Wanalyze-rule=9' option.
Static Analysis Rule 10: This option suggests user to declare structure size in terms of power of 2. Similar to the array size, if the structure size is a power of 2, an expensive multiply operation will be replaced by an inexpensive shift operation. This warning is enabled by `-Wanalyze-rule=10' option.
Static Analysis Rule 11: This option suggests user to make declarations at function scope unless a global scope is required. This warning is enabled by `-Wanalyze-rule=11' option.
Static Analysis Rule 12: This option suggests user to use static qualifier for all file scope declarations. This forces internal linkage else such declarations default to external linkage which might inhibit certain optimizations with some compilers- for example, aggressive inlining. This warning is enabled by `-Wanalyze-rule=12' option.
Static Analysis Rule 13: This option suggests user to declare local variables in descending order according to their base type size. This will help to reduce padding. This warning is enabled by `-Wanalyze-rule=13' option.
Static Analysis Rule 14: This option suggests user to declare structure members in descending order according to their base type size. This will help to reduce padding. This warning is enabled by `-Wanalyze-rule=14' option.
Static Analysis Rule 15: This option suggests user to declare all variables used within an ISR with volatile qualifier. Interrupt service routines often set variables that are tested in main line code. These variables should be declared volatile so that they are not optimized. This warning is enabled by `-Wanalyze-rule=15' option.
Static Analysis Rule 16: This option suggests user to use int instead of short int. This is because operations on int are faster than short. This warning is enabled by `-Wanalyze-rule=16' option.
Static Analysis Rule 17: This option suggests user to declare char and int as signed or unsigned. Processing unsigned variables is faster than signed. Special consideration has to be given to signed variables. For example, When replacing constant division by shift, the result is an extra test and jump, which would not be necessary for an unsigned variable. This warning is enabled by `-Wanalyze-rule=17' option.
Static Analysis Rule 18: This option suggests user to avoid unnecessary divisions. This warning is enabled by `-Wanalyze-rule=18' option.
Static Analysis Rule 19: This option suggests user to check whether first expression in lazy evaluation will be true for most of the times. This warning is enabled by `-Wanalyze-rule=19' option.
Static Analysis Rule 20: This option suggests user to pass minimum number of arguments to the function. According to ABI specifications of targets, first few arguments are passed using registers and rest are pushed on stack. So, in order to avoid stack usage minimum number of arguments should be passed to functions. Check the respective target ABI specification for exact number of arguments passed using registers. This warning is enabled by `-Wanalyze-rule=20' option.
Static Analysis Rule 21: This option suggests user to use `mtinydata' option for H8 targets. This warning is enabled by `-Wanalyze-rule=21' option.
Static Analysis Rule 22: This option suggests user to use optimized libraries for H8 targets. This warning is enabled by `-Wanalyze-rule=22' option.
Static Analysis Rule 23: This option suggests user to use `mrelax' option for SH and H8 targets. This warning is enabled by `-Wanalyze-rule=23' option.
Static Analysis Rule 24: This option suggests user to use `ffast-math' option for SH targets. This warning is enabled by `-Wanalyze-rule=24' option.
SALIENT FEATURES:
1. GNUSH v0701 is based on gcc-4.2-20061205, binutils-061211, newlib-1.14.0 and gdb-6.6 (released).
2. Latest patches have been applied to gcc, binutils and newlib sources.
CHANGES IN THIS RELEASE:
BINUTILS:
1. If '.data' section is empty, the '.bss' section follows '.rodata' section instead of following the '.data' section. Due to this, all un-initialized variables are placed in ROM area. However, this can be avoided by modifying the linker script for '.bss' to follow '.data' section by using '_edata' label OR just by declaring a dummy initialized variable that will be placed in the '.data' section.
This bug has been fixed.
2. The linker built-in function LOADADDR(section) was returning sum of LMA and VMA of the named section instead of returning the value of LMA only.
This problem has been fixed in v0701 release.
3. There is a change in the Linker source of Binutils 2.17 - 20061211 snapshot, used in v0701 release of KPIT toolchains. Due to this change, all the sections in the linker script need to be arranged in the ascending order of their load addresses. Else the linker generates the "dot moved backwards before `.<section-name>'" warning message, where "Dot" refers to the location counter.
OPTIMIZED LIBRARIES:
1. The optimized library routine "_subsf3" generated wrong results in some cases.
This bug has been fixed.
KNOWN PROBLEMS:
We intend to fix the known problems in our future releases.
We also release Maintenance Packs for critical bugs fixed in between releases.
SH-ELF:
Windows and GNU/Linux:
1. Math libraries (excluding standard C library) with '-mrenesas' option are not working for SH2A-single CPU.
* Latest version (v0702) of free GNUSH, GNUH8 and GNUM16CM32C toolchains are
released.
* Optimized libraries have been provided for SH target.
* Improved Interoperability between Renesas SHC and GNUSH.
* Latest version (v0703) of free GNUSH, GNUH8 and GNUM16CM32C toolchains are
released.
* The KPIT HEW GNU Project Generator has been upgraded to 2.0.
* 20 new instructions implemented for the SH2A target.
* Toolchain installers for Windows have been modified to incorporate Activation
Code. Registered users can retrieve their activation code from
http://www.kpitgnutools.com/updateCustomers.php
* A consolidated PDF user guide for GNUSH toolchain is provided along with this
toolchain. It is also available at
http://www.kpitgnutools.com
1. The GNUSH v0801 is based on gcc-4.2-20071128, binutils-2.18, newlib-1.15.0 and gdb-6.6 (released).
2. The latest patches are applied to gcc, binutils and newlib sources. For the patches applied to the GNUSH toolchain, please refer to the following link,
http://www.kpitgnutools.com/phpmyfaq/index.php?
aktion=artikel&rubrik=002004&id=78&lang=en
3. The toolchain support DLL is upgraded from API version 2.0 to 2.5.
The user can double click on the error/warning messages, generated using the Makefile Build system to view the source code responsible for the error/warning.
4. For windows toolchains integrated with HEW, HEW Sample application projects and HEW Simulated I/O samples are installed along with the command-line
samples.
1. The GNUSH v0802 is based on gcc-4.2-20080402, binutils-2.18.50, newlib-1.16.0 and gdb-6.8 (released).
2. The latest patches are applied to gcc, binutils and newlib sources. Please refer to the link given below for the patches applied to the GNUSH toolchain, http://www.kpitgnutools.com/phpmyfaq/index.php?aktion=artikel&rubrik=002004&id=78&lang=en
3. A new binary utility, "sh-elf-libgen", is provided along with this toolchain. This utility builds the standard/optimized libraries with customized compiler and assembler options. Until now, only the pre-built libraries were provided with the toolchain.
4. A new phase "Library Generator" is added in HEW for supporting the "sh-elf-libgen" tool.
5. The "-mfmovd" option has been disabled for the entire SH port as this option
results in an address error for some double precision operations.
* The KPIT GNUH8, GNUM16CM32C and GNUSH toolchain installers are upgraded to
support installation on Windows Vista.
* An assembler option '-h-tick-hex' is added to support "H'00" syntax for
hexadecimal representation in GNUH8, GNUSH and GNUM16CM32C toolchains.
* GNUH8 : Bit manipulation instructions (BNOT, BSET, BCLR and BILD) are
implemented for H8SX target for register indirect addressing mode.
* GNUH8 : Conditional bit instructions (BCLR/EQ, BCLR/NE, BSET/EQ and BCLR/EQ)
are implemented for H8SX target to improve code optimisation.
* GNUH8 and GNUSH : The optlib functions are enhanced to improve code
1. The GNUSH v0803 is based on gcc-4.3.1 [released], binutils-2.18.50 [dated 30th July 2008], newlib-1.16.0 [released], gdb-6.8.50 [dated 11th August 2008].
2. The latest patches are applied to gcc, binutils and newlib sources. Please refer to the following link for the patches applied to the GNUSH toolchain,
http://www.kpitgnutools.com/phpmyfaq/index.php?aktion=artikel&rubrik=002004&id=78&lang=en
3. The KPIT GNUSH toolchain installer is upgraded to support installation on Windows Vista.
KPIT Cummins Infosystems Limited is releasing GNUSH v0901, a cross compiler toolchain for Renesas (formerly Hitachi and Mitsubishi) SH series of
microcontrollers.
SALIENT FEATURES:
1. The GNUSH v0901 is based on gcc-4.3.2 [released], binutils-2.19 [released], newlib-1.16.0 [released], gdb-6.8.50 [dated 11th August 2008].
2. The latest patches are applied to gcc, binutils and newlib sources.
Please refer to the following link for the patches applied to the GNUSH toolchain,
http://www.kpitgnutools.com/phpmyfaq/index.php?aktion=artikel&rubrik=002004&id=78&lang=en
3. A new utility, "unifile", is provided along with GNUSH v0901 toolchain. This utility combines two or more Motorola format files (S-Record / Mot file) or Intel format files (Hex file) to generate a single Motorola format file or Intel format file.
4. The KPIT GNUSH toolchain can now be integrated with HEW4.05 on Windows Vista.
5. GNUSH is now multicore ready. The GNUSH tools now support multi-core SuperH architectures including the newly released SH7205.
For more information on the SH7205 please visit: http://eu.renesas.com/gnumulticore
June 10th, 2009
KPIT Cummins Infosystems Limited is releasing the GNUSH v0902 toolchain, which is a cross compiler tool for Renesas (formerly Hitachi and Mitsubishi) SH series of microcontrollers.
SALIENT FEATURES:
1. The GNUSH v0902 toolchain is based on gcc-4.3.3 [released], binutils-2.19 [released], newlib-1.16.0 [released], gdb-6.8.50 [dated 27th March 2009].
2. The latest patches have been applied to gcc, binutils and newlib sources.
Please refer to the following link for the patches applied to the GNUSH toolchain,
http://www.kpitgnutools.com/phpmyfaq/index.php?aktion=artikel&rubrik=002004&id=78&lang=en
3. The separate GUI interfaces in HEW for the library generator, the compiler, the assembler and the linker build phases have been replaced by a single interface to allow users to make application-wide changes far more easily.
4. The GNUSH v0902 ELF toolchain can also be integrated with KPIT GNU Eclipse v1.0.0. KPIT GNU Eclipse is an Eclipse based Integrated Development Environment (IDE) providing a user interface to KPIT GNUSH ELF toolchains (for Windows and Linux).
KPIT GNU Eclipse complements the Renesas HEW IDE and offers users more options for development.
Please refer to the following link for more information on KPIT GNU Eclipse,
http://www.kpitgnutools.com/releaseNotes.php?view=RNDET&RN=342
5. The v0902 GDBSH debugger is now MinGW based.
ABOUT GNUSH v0902:
Release version: GNUSH v0902
Release Date: June 10th, 2009
Platforms Supported: Red Hat GNU/Linux v8.0 or later (or compatible distribution)
Windows NT/2000/XP/Vista
NOTE: Windows 7 RC is not yet officially supported but early testing shows no compatibility issues
Chilly Willy said:Yeah, I got their notice back on the 10th and downloaded the linux toolchain already. I've been using their SH toolchain to compile my 32X code, and I'll be using it to compile Saturn code once I get around to doing some Saturn stuff. If you use the KPIT toolchain, it would be in your interest to subscribe to their newletter so you'd get these notices in your email. 🙂
October 5th, 2009
KPIT Cummins Infosystems Limited is releasing the GNUSH v0903 toolchain, which is a cross compiler tool for Renesas (formerly Hitachi and Mitsubishi) SH series of microcontrollers.
SALIENT FEATURES:
1. The GNUSH v0903 toolchain is based on gcc-4.4.1 [released], binutils-2.19.1 [released], newlib-1.17.0 [released], gdb-6.8.50 [dated 27th March 2009].
2. The latest patches are applied to gcc, binutils and newlib sources. Please visit the following link for the patches applied to the GNUSH toolchain,
http://www.kpitgnutools.com/phpmyfaq/index.php?aktion=artikel&rubrik=002004&id=78&lang=en
3. The GNUSH v0903 ELF toolchain supports integration with the KPIT GNU Eclipse v1.1.0 and later versions. KPIT GNU Eclipse is an Eclipse based Integrated Development Environment (IDE) providing a user interface to the KPIT GNUSH ELF toolchains (for Windows and Linux). KPIT GNU Eclipse complements the Renesas HEW IDE and offers users more options for development.
Please visit the following link for more information on KPIT GNU Eclipse,
http://www.kpitgnutools.com/releaseNotes.php?view=RNDET&RN=365
4. A new 'optimize' attribute has been added from GCC-4.4 onwards to allow programmers to change the optimisation level and particular optimisation options for an individual function.
Sample use of this attribute is shown below,
int foo(int i) __attribute__((optimize("-O3")));
ABOUT GNUSH v0903 :
Release version: GNUSH v0903
Release Date: October 5th, 2009
Platforms Supported: Red Hat GNU/Linux v8.0 or later (or compatible distribution) Windows NT/2000/XP/Vista
NOTE: The GNUSH v0903 ELF toolchain works on Windows 7. No issues have been observed on this platform. Windows 7 is not yet officially supported, however.
CHANGES IN THIS RELEASE:
This section describes the enhancements made and the issues fixed in the v0903 release.
GCC:
1. When the 'sp_switch' attribute was used for SH targets, compiler generated garbled code for the instruction to assign a new stack pointer (SP) for the interrupt service routine. The issue has now been fixed.
SALIENT FEATURES:
1. The GNUSH v10.01 toolchain is based on gcc-4.4.2 [released], binutils-2.20 [released], newlib-1.17.0 [released] and gdb-6.8.50 [dated 27th March 2010].
2. The latest patches are applied to gcc, binutils and newlib sources.
Please visit the following link for the patches applied to the GNUSH toolchain:
http://www.kpitgnutools.com/phpmyfaq/index.php?aktion=artikel&rubrik=002004&id=78&lang=en
3. The GNUSH v10.01 ELF toolchain supports integration with the KPIT Eclipse.
Please visit the following link for information on latest releases of KPIT Eclipse:
http://www.kpitgnutools.com/releaseNotes.php
ABOUT GNUSH v10.01 :
Release Version: GNUSH v10.01
Release Date: February 19th, 2010
Platforms Supported: Red Hat GNU/Linux v8.0 or later (or compatible distribution)
Windows NT/2000/XP/Vista/Windows 7
Language: C, C99, C++
Targets:
SH-1
SH-2
SH-2A
SH-2E
SH2-DSP
SH-3
SH-3E
SH3-DSP
SH-4
SH-4A
SH-4AL-DSP
Object File Format: ELF
CHANGES IN THIS RELEASE:
This section describes the enhancements made and the issues fixed in the v10.01 release.
GCC:
1. The SH peripheral registers have strict access size requirements with some registers requiring a byte level access and others requiring word level access. The GNUSH compiler generates a word level access instruction "MOV.W" to access all the peripheral registers.
This bug has now been fixed. The peripheral registers can now be accessed as per their pre-defined access type. Users need to use "volatile" keyword while declaring the peripheral registers with strict access size requirement.
Please refer to the following FAQ for details,
http://www.kpitgnutools.com/phpmyfaq/index.php?aktion=artikel&rubrik=002003&id=430&lang=en
2. When the compiler switch "-fcall-saved-gbr" is used to save and restore the "GBR" register inside a function, the GNUSH toolchain generates an internal compiler error (ICE). This bug has now been fixed.
3. For some test cases, the GNUSH v0903 toolchain generates incorrect prologue and epilogue for interrupt service routines. This bug has now been fixed.
4. The GNUSH toolchain did not generate the 'TST' instruction for comparison operation for immediate values greater than 127. This bug has now been fixed.
5. Local variable value is not updated at correct memory location when viewed in GDBSH. This happens when an array of structure is passed as an argument of the function. This bug has now been fixed.
HEW (For Windows OS only):
1. Use of the Flash Development Tool (FDT) plug-ins under HEW is deprecated. Hence, users are advised to download the latest version of the FDT application and use it independently for Flash downloads.
2. In the HEW linker section wizard, the "KEEP" attribute was previously set to a group of sections rather than the individual sections within that group. This bug has now been fixed. Each individual section within the group is now generated with the "KEEP" attribute.
3. In HEW project generation up to v0903, the generated projects do not include the intrinsic header file. Instead, the user must navigate to the migration guide and download from there. In v10.01, the project generation in HEW is modified to include this header in all projects, so that users can use it with minimal work.