diff options
author | Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> | 2016-07-06 11:40:17 +0000 |
---|---|---|
committer | Senthil Kumar Selvaraj <saaadhu@gcc.gnu.org> | 2016-07-06 11:40:17 +0000 |
commit | 7b4e076985f2c41f93fb8d8f89183ef1244f98ae (patch) | |
tree | d0392d7b3b94a0bbf2cfc9cf05df88584da7b228 | |
parent | eb4432f7044e342fa527c2ca6c3991bebb92e874 (diff) | |
download | gcc-7b4e076985f2c41f93fb8d8f89183ef1244f98ae.zip gcc-7b4e076985f2c41f93fb8d8f89183ef1244f98ae.tar.gz gcc-7b4e076985f2c41f93fb8d8f89183ef1244f98ae.tar.bz2 |
re PR target/50739 ([avr] nameless error with -fmerge-all-constants)
Fix PR target/50739
This patch fixes a problem with fmerge-all-constants and the progmem
attribute.
gcc/
PR target/50739
* config/avr/avr.c (avr_asm_select_section): Strip off
SECTION_DECLARED from flags when calling get_section.
testsuite/
PR target/50739
* gcc.target/avr/pr50739.c: New test
From-SVN: r238041
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/avr/avr.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/avr/pr50739.c | 7 |
4 files changed, 21 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c853885..78d2257 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-07-06 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> + + PR target/50739 + * config/avr/avr.c (avr_asm_select_section): Strip off + SECTION_DECLARED from flags when calling get_section. + 2016-07-06 Richard Sandiford <richard.sandiford@arm.com> * tree-vectorizer.h (vect_memory_access_type): Add diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 18ed766..7371f29 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -9641,7 +9641,9 @@ avr_asm_select_section (tree decl, int reloc, unsigned HOST_WIDE_INT align) { const char *sname = ACONCAT ((new_prefix, name + strlen (old_prefix), NULL)); - return get_section (sname, sect->common.flags, sect->named.decl); + return get_section (sname, + sect->common.flags & ~SECTION_DECLARED, + sect->named.decl); } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ea48e66..0e11d8b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-07-06 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> + + PR target/50739 + * gcc.target/avr/pr50739.c: New test. + 2016-07-05 Jan Hubicka <jh@suse.cz> * gcc.dg/tree-ssa/scev-14.c: update template. diff --git a/gcc/testsuite/gcc.target/avr/pr50739.c b/gcc/testsuite/gcc.target/avr/pr50739.c new file mode 100644 index 0000000..a6850b7 --- /dev/null +++ b/gcc/testsuite/gcc.target/avr/pr50739.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-options "-fmerge-all-constants" } */ + +char *ca = "123"; + +const char a[] __attribute__((__progmem__))= "a"; +const char b[] __attribute__((__progmem__))= "b"; |