Commit 427ee360 by Dean Ferreyra Committed by Denis Chertykov

re PR target/14047 (__progmem__ attribute doesn't work)

	PR target/14047
	* config/avr/avr.c (avr_progmem_p): Add "attributes" parameter.
	(avr_insert_attributes): Pass "attributes" to avr_progmem_p.
	* config/avr/avr-protos.h (avr_progmem_p): Change prototype.

From-SVN: r79433
parent 58354fa8
...@@ -42,7 +42,7 @@ extern void gas_output_ascii (FILE *file, const char *str, size_t length); ...@@ -42,7 +42,7 @@ extern void gas_output_ascii (FILE *file, const char *str, size_t length);
#ifdef TREE_CODE #ifdef TREE_CODE
extern void asm_output_external (FILE *file, tree decl, char *name); 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 */ #ifdef RTX_CODE /* inside TREE_CODE */
extern rtx avr_function_value (tree type, tree func); extern rtx avr_function_value (tree type, tree func);
......
...@@ -4575,7 +4575,7 @@ avr_handle_fndecl_attribute (tree *node, tree name, ...@@ -4575,7 +4575,7 @@ avr_handle_fndecl_attribute (tree *node, tree name,
if found return 1, otherwise 0. */ if found return 1, otherwise 0. */
int int
avr_progmem_p (tree decl) avr_progmem_p (tree decl, tree attributes)
{ {
tree a; tree a;
...@@ -4583,7 +4583,7 @@ avr_progmem_p (tree decl) ...@@ -4583,7 +4583,7 @@ avr_progmem_p (tree decl)
return 0; return 0;
if (NULL_TREE if (NULL_TREE
!= lookup_attribute ("progmem", DECL_ATTRIBUTES (decl))) != lookup_attribute ("progmem", attributes))
return 1; return 1;
a=decl; a=decl;
...@@ -4607,7 +4607,7 @@ avr_insert_attributes (tree node, tree *attributes) ...@@ -4607,7 +4607,7 @@ avr_insert_attributes (tree node, tree *attributes)
{ {
if (TREE_CODE (node) == VAR_DECL if (TREE_CODE (node) == VAR_DECL
&& (TREE_STATIC (node) || DECL_EXTERNAL (node)) && (TREE_STATIC (node) || DECL_EXTERNAL (node))
&& avr_progmem_p (node)) && avr_progmem_p (node, *attributes))
{ {
static const char dsec[] = ".progmem.data"; static const char dsec[] = ".progmem.data";
*attributes = tree_cons (get_identifier ("section"), *attributes = tree_cons (get_identifier ("section"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment