avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] AVR gcc-3.4-20040128 progmem trouble


From: Dean Ferreyra
Subject: Re: [avr-gcc-list] AVR gcc-3.4-20040128 progmem trouble
Date: Mon, 16 Feb 2004 16:05:50 -0800
User-agent: Mozilla Thunderbird 0.5 (Windows/20040207)

Artur Lipowski wrote:
E. Weddington wrote:
...

Please do ASAP since 3.4 is in stage 3.

Maybe one of the AVR GCC developers such as Dennis or Marek can
take a look at this?

Done.

If somebody interested in bug catching progress, there is possibilty
to put ourselfs on the CC list.

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

Does anyone know of an official fix for this yet?

I've been using the attached patch successfully on my projects, though I must say I don't know the first thing about gcc internals.

Dean
Index: gcc/config/avr/avr-protos.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/avr/avr-protos.h,v
retrieving revision 1.31
diff -a -u -r1.31 avr-protos.h
--- gcc/config/avr/avr-protos.h 13 Oct 2003 08:40:44 -0000      1.31
+++ gcc/config/avr/avr-protos.h 16 Feb 2004 21:22:12 -0000
@@ -42,7 +42,7 @@
 
 #ifdef TREE_CODE
 extern void asm_output_external (FILE *file, tree decl, char *name);
-extern int avr_progmem_p (tree decl);
+extern int avr_progmem_p (tree decl, tree attributes);
 
 #ifdef RTX_CODE /* inside TREE_CODE */
 extern rtx avr_function_value (tree type, tree func);
Index: gcc/config/avr/avr.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/avr/avr.c,v
retrieving revision 1.116
diff -a -u -r1.116 avr.c
--- gcc/config/avr/avr.c        8 Feb 2004 23:08:38 -0000       1.116
+++ gcc/config/avr/avr.c        16 Feb 2004 21:22:17 -0000
@@ -4574,7 +4574,7 @@
    if found return 1, otherwise 0.  */
 
 int
-avr_progmem_p (tree decl)
+avr_progmem_p (tree decl, tree attributes)
 {
   tree a;
 
@@ -4582,7 +4582,7 @@
     return 0;
 
   if (NULL_TREE
-      != lookup_attribute ("progmem", DECL_ATTRIBUTES (decl)))
+      != lookup_attribute ("progmem", attributes))
     return 1;
 
   a=decl;
@@ -4606,7 +4606,7 @@
 {
   if (TREE_CODE (node) == VAR_DECL
       && (TREE_STATIC (node) || DECL_EXTERNAL (node))
-      && avr_progmem_p (node))
+      && avr_progmem_p (node, *attributes))
     {
       static const char dsec[] = ".progmem.data";
       *attributes = tree_cons (get_identifier ("section"),

reply via email to

[Prev in Thread] Current Thread [Next in Thread]