Yet another new feature in 4.7, committed Johann
Index: changes.html =================================================================== RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.7/changes.html,v retrieving revision 1.108 diff -u -p -r1.108 changes.html --- changes.html 21 Apr 2012 00:00:20 -0000 1.108 +++ changes.html 1 Jun 2012 09:15:18 -0000 @@ -676,6 +676,21 @@ int add_values (const __flash int *p, in <li>New command-line options <code>-maccumulate-args</code>, <code>-mbranch-cost=<i>cost</i></code> and <code>-mstrict-X</code> were added to allow better fine-tuning of code optimization.</li> + <li>A new inline assembler print modifier <code>%i</code> to print a RAM address as I/O + address has been added: + + <blockquote><pre> +#include <avr/io.h> /* Port Definitions from AVR-LibC */ + +void set_portb (uint8_t value) +{ + asm volatile ("out %0, %i1" :: "r" (value), "n" (&PORTB) : "memory"); +}</pre></blockquote> + The offset between an I/O address and a RAM address for that I/O + location is device-specific. This offset is taken into account when + printing a RAM address with the <code>%i</code> modifier so that the + address is suitable to be used as operand in an I/O command. + The address must be a constant integer known at compile time.</li> <li>Many optimizations to: <ul> <li>64-bit integer arithmetic</li>