For the following 1-liner I get an error with current trunk r177267:
const __pgm char * pallo = "pallo";
__pgm as a named address space qualifier.
>$TV/xgcc -B$TV pgm.c -c -save-temps -dp -mmcu=atmega8
<addr_space_convert_expr 0xb74cdfc0
type <pointer_type 0xb74c7f60
type <integer_type 0xb74c7f00 char readonly address-space-1 string-flag
QI
size <integer_cst 0xb745b1a4 constant 8>
unit size <integer_cst 0xb745b1b8 constant 1>
align 8 symtab 0 alias set -1 canonical type 0xb74c7f00 precision 8
min <integer_cst
0xb745b17c -128> max <integer_cst 0xb745b208 127>
pointer_to_this <pointer_type 0xb74c7f60>>
unsigned PHI
size <integer_cst 0xb745b064 constant 16>
unit size <integer_cst 0xb745b078 constant 2>
align 8 symtab 0 alias set -1 canonical type 0xb74c7f60>
readonly constant
arg 0 <nop_expr 0xb74cdfa8
type <pointer_type 0xb7473f00 type <integer_type 0xb746a240 char>
unsigned HI size <integer_cst 0xb745b064 16> unit size <integer_cst
0xb745b078 2>
align 8 symtab 0 alias set -1 canonical type 0xb7473f00>
readonly constant
arg 0 <addr_expr 0xb74cdf90 type <pointer_type 0xb74db120>
readonly constant
arg 0 <string_cst 0xb74cdf78 type <array_type 0xb74db0c0>
readonly constant static "pallo\000">
pgm.c:1:28>
pgm.c:1:28>
pgm.c:1:28>
pgm.c:1:1: error: initializer element is not computable at load time
Is that a flaw in c-typeck.c?
I know the line worked some time ago; from time to time I merge trunk into
the named address space support for AVR which is not in SVN.
If you need the patch to reproduce the bug I will upload the patch, of course.
No BE hook is called for the tree.
Moreover, if a user writes a line like
const __pgm char * pallo = "pallo";
he wants the string literal to be placed in the non-default address
space. There is no other way to express that except something like
const __pgm char * pallo = (const __pgm char*) "pallo";
which doesn't work either and triggers
pgm.c:1:1: error: initializer element is not constant
with a tree dump similar to above.
Johann