This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/13428] gcc-avr doesn't work non-constant array references


------- Additional Comments From ken at realtronix dot net  2003-12-25 05:30 -------
(In reply to comment #6)
> What is your compiler options?
> Could you explain the bug a little more and/or provide a shorter testcase?
> Does your testcase expose a bug even if you remove the first two strcpy_P?
> Which address is wrong?  The destination or the source?
> What if you get 'i' from some function call instead of a for loop like so?
>  
>   i = baz ();
>   strcpy_P(buf[i], Langs[i]);


My complier options are as follows:

avr-gcc -MM -mmcu=atmega103 -I. -g -Os -funsigned-char -funsigned-bitfields -
fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=pgmbug.lst  -
std=gnu99 pgmbug.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > pgmbug.d; \

The bug still exposes even if I remove the firs 2 constant indexed strcpy_P.
However, I found that if I supress optimization, even constant indexed 
strcpy_P does NOT work at all. It seems that the source address pass to 
strcpy_P was wrong, the destination address was correct in any case. I tried 
to get i from a fuction call like i = baz (), the bug still exposes.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13428


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]