public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/34734] attribute((progmem)) not handled properly in C++ for AVRs
       [not found] <bug-34734-4@http.gcc.gnu.org/bugzilla/>
@ 2011-02-06 12:24 ` Kicer86 at gmail dot com
  2011-06-29  7:58 ` gjl at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Kicer86 at gmail dot com @ 2011-02-06 12:24 UTC (permalink / raw)
  To: gcc-bugs

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

Michał Walenciak <Kicer86 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Kicer86 at gmail dot com

--- Comment #5 from Michał Walenciak <Kicer86 at gmail dot com> 2011-02-06 12:19:00 UTC ---
same problem in 4.5.2.
Maybe importance of this bug should be increased? Imho it's a little bit
embarrassing to keep this bug so long... (since 2008, over 3 yrs!)

regards


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/34734] attribute((progmem)) not handled properly in C++ for AVRs
       [not found] <bug-34734-4@http.gcc.gnu.org/bugzilla/>
  2011-02-06 12:24 ` [Bug target/34734] attribute((progmem)) not handled properly in C++ for AVRs Kicer86 at gmail dot com
@ 2011-06-29  7:58 ` gjl at gcc dot gnu.org
  2011-06-30 13:30 ` gjl at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-06-29  7:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-06-29 07:57:28 UTC ---
Author: gjl
Date: Wed Jun 29 07:57:25 2011
New Revision: 175621

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175621
Log:
    PR target/34734
    * config/avr/avr.c (avr_handle_progmem_attribute): Move warning 
    about uninitialized data attributed 'progmem' from here...
    (avr_encode_section_info): ...to this new function.
    (TARGET_ENCODE_SECTION_INFO): New define.
    (avr_section_type_flags): For data in ".progmem.data", remove
    section flag SECTION_WRITE.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/avr/avr.c


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/34734] attribute((progmem)) not handled properly in C++ for AVRs
       [not found] <bug-34734-4@http.gcc.gnu.org/bugzilla/>
  2011-02-06 12:24 ` [Bug target/34734] attribute((progmem)) not handled properly in C++ for AVRs Kicer86 at gmail dot com
  2011-06-29  7:58 ` gjl at gcc dot gnu.org
@ 2011-06-30 13:30 ` gjl at gcc dot gnu.org
  2011-06-30 13:41 ` gjl at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-06-30 13:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-06-30 13:28:46 UTC ---
Author: gjl
Date: Thu Jun 30 13:28:43 2011
New Revision: 175705

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175705
Log:

    PR target/34734
    Backport from mainline
    * config/avr/avr.c (avr_handle_progmem_attribute): Move warning 
    about uninitialized data attributed 'progmem' from here...
    (avr_encode_section_info): ...to this new function.
    (TARGET_ENCODE_SECTION_INFO): New define.
    (avr_section_type_flags): For data in ".progmem.data", remove
    section flag SECTION_WRITE.


Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/config/avr/avr.c


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/34734] attribute((progmem)) not handled properly in C++ for AVRs
       [not found] <bug-34734-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2011-06-30 13:30 ` gjl at gcc dot gnu.org
@ 2011-06-30 13:41 ` gjl at gcc dot gnu.org
  2011-06-30 13:48 ` gjl at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-06-30 13:41 UTC (permalink / raw)
  To: gcc-bugs

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

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|NEW                         |RESOLVED
                 CC|                            |gjl at gcc dot gnu.org
      Known to work|                            |4.6.2
         Resolution|                            |FIXED
   Target Milestone|---                         |4.6.2
      Known to fail|                            |4.6.1

--- Comment #8 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-06-30 13:39:18 UTC ---
Closed as resolved+fixed.

(In reply to comment #5)
> same problem in 4.5.2.
> Maybe importance of this bug should be increased? Imho it's a little bit
> embarrassing to keep this bug so long... (since 2008, over 3 yrs!)
> regards

Increasing importance won't help.  The only thing that would help is increasing
number of people that are inclined to improve avr-gcc.

regards

Note that progmem on types is not documented an not supposed to work at all.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/34734] attribute((progmem)) not handled properly in C++ for AVRs
       [not found] <bug-34734-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2011-06-30 13:41 ` gjl at gcc dot gnu.org
@ 2011-06-30 13:48 ` gjl at gcc dot gnu.org
  2011-07-04 12:51 ` gjl at gcc dot gnu.org
  2014-02-16 10:03 ` [Bug target/34734] [4.2/4.3/4.5/4.6 Regression][avr] attribute((progmem)) not handled properly in C++ jackie.rosen at hushmail dot com
  6 siblings, 0 replies; 12+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-06-30 13:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-06-30 13:45:08 UTC ---
Author: gjl
Date: Thu Jun 30 13:45:04 2011
New Revision: 175706

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175706
Log:
    PR target/34734
    Backport from mainline
    (avr_section_type_flags): For data in ".progmem.data", remove
    section flag SECTION_WRITE.

Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/config/avr/avr.c


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/34734] attribute((progmem)) not handled properly in C++ for AVRs
       [not found] <bug-34734-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2011-06-30 13:48 ` gjl at gcc dot gnu.org
@ 2011-07-04 12:51 ` gjl at gcc dot gnu.org
  2014-02-16 10:03 ` [Bug target/34734] [4.2/4.3/4.5/4.6 Regression][avr] attribute((progmem)) not handled properly in C++ jackie.rosen at hushmail dot com
  6 siblings, 0 replies; 12+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-07-04 12:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-07-04 12:48:07 UTC ---
Author: gjl
Date: Mon Jul  4 12:48:04 2011
New Revision: 175811

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175811
Log:
    PR target/34734
    PR target/44643
    * gcc.target/avr/avr.exp: Run over cpp files, too.
    * gcc.target/avr/torture/avr-torture.exp: Ditto.
    * gcc.target/avr/progmem.h: New file.
    * gcc.target/avr/exit-abort.h: New file.
    * gcc.target/avr/progmem-error-1.c: New file.
    * gcc.target/avr/progmem-error-1.cpp: New file.
    * gcc.target/avr/progmem-warning-1.c: New file.
    * gcc.target/avr/torture/progmem-1.c: New file.
    * gcc.target/avr/torture/progmem-1.cpp: New file.


Added:
    trunk/gcc/testsuite/gcc.target/avr/exit-abort.h
    trunk/gcc/testsuite/gcc.target/avr/progmem-error-1.c
    trunk/gcc/testsuite/gcc.target/avr/progmem-error-1.cpp
    trunk/gcc/testsuite/gcc.target/avr/progmem-warning-1.c
    trunk/gcc/testsuite/gcc.target/avr/progmem.h
    trunk/gcc/testsuite/gcc.target/avr/torture/progmem-1.c
    trunk/gcc/testsuite/gcc.target/avr/torture/progmem-1.cpp
Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.target/avr/avr.exp
    trunk/gcc/testsuite/gcc.target/avr/torture/avr-torture.exp


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/34734] [4.2/4.3/4.5/4.6 Regression][avr] attribute((progmem)) not handled properly in C++
       [not found] <bug-34734-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2011-07-04 12:51 ` gjl at gcc dot gnu.org
@ 2014-02-16 10:03 ` jackie.rosen at hushmail dot com
  6 siblings, 0 replies; 12+ messages in thread
From: jackie.rosen at hushmail dot com @ 2014-02-16 10:03 UTC (permalink / raw)
  To: gcc-bugs

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

Jackie Rosen <jackie.rosen at hushmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jackie.rosen at hushmail dot com

--- Comment #11 from Jackie Rosen <jackie.rosen at hushmail dot com> ---
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen from the domain http://volichat.com
Marked for reference. Resolved as fixed @bugzilla.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/34734] attribute((progmem)) not handled properly in C++ for AVRs
  2008-01-11  2:28 [Bug c++/34734] New: attribute((progmem)) not handled properly in C++ for AVRs markuslampert at yahoo dot com
                   ` (3 preceding siblings ...)
  2009-08-07 19:18 ` eric dot weddington at atmel dot com
@ 2010-06-09  9:16 ` mschulze at ivs dot cs dot ovgu dot de
  4 siblings, 0 replies; 12+ messages in thread
From: mschulze at ivs dot cs dot ovgu dot de @ 2010-06-09  9:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from mschulze at ivs dot cs dot ovgu dot de  2010-06-09 09:16 -------
I found a way to place data in program memory for C++ without producing the
annoying warnings. The trick is omiting __attribute__((__progmem__)) and
instead always use __attribute__((section(".progmem.something"))) for placing
your data into a special section beginning with ".progmem.". I tested this with
different avr-g++ compiler versions (3.4.4, 4.1.1, 4.2.1, 4.3.3, 4.4.0, and
4.4.3), and it always results in the desired behavior.

Example:
[mschulze@teeth tst]$ cat progmem.cpp 
static char __attribute((section(".progmem.something"))) str[]="program memory
data";

const char* test() {
    return str;
}
[mschulze@teeth tst]$ /usr/bin/avr-g++ -Wall -mmcu=atmega1281 -c progmem.cpp 
[mschulze@teeth tst]$ /usr/bin/avr-g++ --version
avr-g++ (GCC) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[mschulze@teeth tst]$ 

Regards,
Michael


-- 

mschulze at ivs dot cs dot ovgu dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mschulze at ivs dot cs dot
                   |                            |ovgu dot de


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/34734] attribute((progmem)) not handled properly in C++ for AVRs
  2008-01-11  2:28 [Bug c++/34734] New: attribute((progmem)) not handled properly in C++ for AVRs markuslampert at yahoo dot com
                   ` (2 preceding siblings ...)
  2009-08-07 19:16 ` eric dot weddington at atmel dot com
@ 2009-08-07 19:18 ` eric dot weddington at atmel dot com
  2010-06-09  9:16 ` mschulze at ivs dot cs dot ovgu dot de
  4 siblings, 0 replies; 12+ messages in thread
From: eric dot weddington at atmel dot com @ 2009-08-07 19:18 UTC (permalink / raw)
  To: gcc-bugs



-- 

eric dot weddington at atmel dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|                            |4.2.2 4.2.1 4.3.2
   Last reconfirmed|0000-00-00 00:00:00         |2009-08-07 19:18:06
               date|                            |


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/34734] attribute((progmem)) not handled properly in C++ for AVRs
  2008-01-11  2:28 [Bug c++/34734] New: attribute((progmem)) not handled properly in C++ for AVRs markuslampert at yahoo dot com
  2008-02-02  8:12 ` [Bug target/34734] " ilgb at livius dot net
  2008-03-07 21:00 ` hsteinhaus at gmx dot de
@ 2009-08-07 19:16 ` eric dot weddington at atmel dot com
  2009-08-07 19:18 ` eric dot weddington at atmel dot com
  2010-06-09  9:16 ` mschulze at ivs dot cs dot ovgu dot de
  4 siblings, 0 replies; 12+ messages in thread
From: eric dot weddington at atmel dot com @ 2009-08-07 19:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from eric dot weddington at atmel dot com  2009-08-07 19:16 -------
*** Bug 40112 has been marked as a duplicate of this bug. ***


-- 

eric dot weddington at atmel dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sb-sf at users dot
                   |                            |sourceforge dot net


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/34734] attribute((progmem)) not handled properly in C++ for AVRs
  2008-01-11  2:28 [Bug c++/34734] New: attribute((progmem)) not handled properly in C++ for AVRs markuslampert at yahoo dot com
  2008-02-02  8:12 ` [Bug target/34734] " ilgb at livius dot net
@ 2008-03-07 21:00 ` hsteinhaus at gmx dot de
  2009-08-07 19:16 ` eric dot weddington at atmel dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: hsteinhaus at gmx dot de @ 2008-03-07 21:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from hsteinhaus at gmx dot de  2008-03-07 20:59 -------
version 4.2.1 seems to be affected as well:

--------------------------------------------
holger@x:~/scratch$ cat foo.cpp
#include <avr/pgmspace.h>

const int foobar1 = 42;
int foobar2 = 42;
const int PROGMEM foobar3 = 42;
int PROGMEM foobar4 = 42;

holger@x:~/scratch$ avr-g++ -Wall -mmcu=atmega1281 -c foo.cpp
foo.cpp:5: warning: only initialized variables can be placed into program
memory area
foo.cpp:6: warning: only initialized variables can be placed into program
memory area
holger@x:~/scratch$ avr-g++ --version
avr-g++ (GCC) 4.2.1 (SUSE Linux)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


-- 


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/34734] attribute((progmem)) not handled properly in C++ for AVRs
  2008-01-11  2:28 [Bug c++/34734] New: attribute((progmem)) not handled properly in C++ for AVRs markuslampert at yahoo dot com
@ 2008-02-02  8:12 ` ilgb at livius dot net
  2008-03-07 21:00 ` hsteinhaus at gmx dot de
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: ilgb at livius dot net @ 2008-02-02  8:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from ilgb at livius dot net  2008-02-02 08:11 -------
after upgrading to WinAVR-20071221 my C++ projects trigger the same warning
message.

for completeness, my sources look like:


// usb_user_device_descriptor
PROGMEM S_usb_device_descriptor usb_dev_desc =
  {
    sizeof( usb_dev_desc ), DEVICE_DESCRIPTOR,
    U_WORD( USB_SPECIFICATION ), DEVICE_CLASS,
    DEVICE_SUB_CLASS, DEVICE_PROTOCOL, EP_CONTROL_LENGTH,
    U_WORD( VENDOR_ID ),
    U_WORD( PRODUCT_ID ),
    U_WORD( RELEASE_NUMBER ), STRING_INDEX_MAN, STRING_INDEX_PROD,
    STRING_INDEX_SN, NB_CONFIGURATION
  };

Liviu


-- 

ilgb at livius dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ilgb at livius dot net


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-02-16 10:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-34734-4@http.gcc.gnu.org/bugzilla/>
2011-02-06 12:24 ` [Bug target/34734] attribute((progmem)) not handled properly in C++ for AVRs Kicer86 at gmail dot com
2011-06-29  7:58 ` gjl at gcc dot gnu.org
2011-06-30 13:30 ` gjl at gcc dot gnu.org
2011-06-30 13:41 ` gjl at gcc dot gnu.org
2011-06-30 13:48 ` gjl at gcc dot gnu.org
2011-07-04 12:51 ` gjl at gcc dot gnu.org
2014-02-16 10:03 ` [Bug target/34734] [4.2/4.3/4.5/4.6 Regression][avr] attribute((progmem)) not handled properly in C++ jackie.rosen at hushmail dot com
2008-01-11  2:28 [Bug c++/34734] New: attribute((progmem)) not handled properly in C++ for AVRs markuslampert at yahoo dot com
2008-02-02  8:12 ` [Bug target/34734] " ilgb at livius dot net
2008-03-07 21:00 ` hsteinhaus at gmx dot de
2009-08-07 19:16 ` eric dot weddington at atmel dot com
2009-08-07 19:18 ` eric dot weddington at atmel dot com
2010-06-09  9:16 ` mschulze at ivs dot cs dot ovgu dot de

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).