public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/13610] New: __attribute__((progmem)) allocation problem
@ 2004-01-07 22:45 sergey at idknet dot com
2004-01-07 22:51 ` [Bug target/13610] " pinskia at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: sergey at idknet dot com @ 2004-01-07 22:45 UTC (permalink / raw)
To: gcc-bugs
Configured with: ./configure --prefix=/usr --target=avr --program-prefix=avr-
--enable-languages=c,c++
Thread model: single
gcc version 3.3.2
in source:
__attribute__((progmem)) char *tokens[] = {"hello1", "hello2", "hello3"};
__attribute__((progmem)) char test[] = {'a','b','c'};
allocates var tokens (array of pointers) into progmem, but strings "hello1",
"hello2", "hello3" - into sram (.data) (must be in progmem too).
in case with char test[] anything fine: array & data allocated into progmem.
Due to ram limitation on avr it's very important to keep such constant strings
in program memory (flash).
Question: how can I allocate this srtings into progmem for now?
--
Summary: __attribute__((progmem)) allocation problem
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sergey at idknet dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: avr
GCC target triplet: avr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13610
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/13610] __attribute__((progmem)) allocation problem
2004-01-07 22:45 [Bug c/13610] New: __attribute__((progmem)) allocation problem sergey at idknet dot com
@ 2004-01-07 22:51 ` pinskia at gcc dot gnu dot org
2004-02-11 0:05 ` eric at ecentral dot com
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-07 22:51 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-07 22:51 -------
Confirmed, the problem is in the target code, it just references the address.
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Status|UNCONFIRMED |NEW
Component|c |target
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-01-07 22:51:30
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13610
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/13610] __attribute__((progmem)) allocation problem
2004-01-07 22:45 [Bug c/13610] New: __attribute__((progmem)) allocation problem sergey at idknet dot com
2004-01-07 22:51 ` [Bug target/13610] " pinskia at gcc dot gnu dot org
@ 2004-02-11 0:05 ` eric at ecentral dot com
2004-02-11 0:13 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: eric at ecentral dot com @ 2004-02-11 0:05 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From eric at ecentral dot com 2004-02-11 00:05 -------
AFAIK, this is not a bug.
See the avr-libc user manual (temporarily housed here, due to Savannah
problems):
<http://jubal.westnet.com/AVR/doc/avr-libc-user-manual/>
Specifically in the FAQ:
<http://jubal.westnet.com/AVR/doc/avr-libc-user-manual/FAQ.html#faq_rom_array>
This is how it has historically worked.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |eric at ecentral dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13610
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/13610] __attribute__((progmem)) allocation problem
2004-01-07 22:45 [Bug c/13610] New: __attribute__((progmem)) allocation problem sergey at idknet dot com
2004-01-07 22:51 ` [Bug target/13610] " pinskia at gcc dot gnu dot org
2004-02-11 0:05 ` eric at ecentral dot com
@ 2004-02-11 0:13 ` pinskia at gcc dot gnu dot org
2004-02-12 23:30 ` sergey at idknet dot com
2004-02-12 23:53 ` eric at ecentral dot com
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-11 0:13 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-02-11 00:13 -------
Not a bug.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13610
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/13610] __attribute__((progmem)) allocation problem
2004-01-07 22:45 [Bug c/13610] New: __attribute__((progmem)) allocation problem sergey at idknet dot com
` (2 preceding siblings ...)
2004-02-11 0:13 ` pinskia at gcc dot gnu dot org
@ 2004-02-12 23:30 ` sergey at idknet dot com
2004-02-12 23:53 ` eric at ecentral dot com
4 siblings, 0 replies; 6+ messages in thread
From: sergey at idknet dot com @ 2004-02-12 23:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From sergey at idknet dot com 2004-02-12 23:30 -------
(In reply to comment #2)
> AFAIK, this is not a bug.
>
> This is how it has historically worked.
Ok, but afaik, on x86 platform, compiler will place both array and strings into
same segment. Why this can't be on avr? I'm not sure how the things works
exactly, but it seems that this not depends on avr-libc. Link You shown explains
how to make this work correctly just because this not works as expected.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13610
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/13610] __attribute__((progmem)) allocation problem
2004-01-07 22:45 [Bug c/13610] New: __attribute__((progmem)) allocation problem sergey at idknet dot com
` (3 preceding siblings ...)
2004-02-12 23:30 ` sergey at idknet dot com
@ 2004-02-12 23:53 ` eric at ecentral dot com
4 siblings, 0 replies; 6+ messages in thread
From: eric at ecentral dot com @ 2004-02-12 23:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From eric at ecentral dot com 2004-02-12 23:53 -------
Subject: Re: __attribute__((progmem)) allocation problem
On 12 Feb 2004 at 23:30, sergey at idknet dot com wrote:
>
> ------- Additional Comments From sergey at idknet dot com 2004-02-12 23:30
> ------- (In reply to comment #2) > AFAIK, this is not a bug. > > This is how it
> has historically worked.
>
> Ok, but afaik, on x86 platform, compiler will place both array and strings into
> same segment. Why this can't be on avr? I'm not sure how the things works
> exactly, but it seems that this not depends on avr-libc. Link You shown explains
> how to make this work correctly just because this not works as expected.
Sorry, you are comparing apples to oranges. Just because x86 platform behaves
one way does not mean that is how it works on the AVR platform. It does not
work as "expected" because your expectation was derived from the x86 platform,
not as how it works on the AVR. The avr-libc documenation is the most complete
and up-to-date documentation on how to use the AVR port of GCC. If you would
like this feature changed, perhaps you can write to the AVR port maintainers of
GCC.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13610
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-02-12 23:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-07 22:45 [Bug c/13610] New: __attribute__((progmem)) allocation problem sergey at idknet dot com
2004-01-07 22:51 ` [Bug target/13610] " pinskia at gcc dot gnu dot org
2004-02-11 0:05 ` eric at ecentral dot com
2004-02-11 0:13 ` pinskia at gcc dot gnu dot org
2004-02-12 23:30 ` sergey at idknet dot com
2004-02-12 23:53 ` eric at ecentral dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).