public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/65507] New: avr-gcc -f-merge-all-constants causes internal compiler error in get_section, at varasm.c:312
@ 2015-03-21 23:38 dfnsonfsduifb at gmx dot de
  2015-03-22  2:22 ` [Bug c/65507] " dfnsonfsduifb at gmx dot de
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: dfnsonfsduifb at gmx dot de @ 2015-03-21 23:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65507

            Bug ID: 65507
           Summary: avr-gcc -f-merge-all-constants causes internal
                    compiler error in get_section, at varasm.c:312
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dfnsonfsduifb at gmx dot de

Compiler:
Using built-in specs.
COLLECT_GCC=/home/joe/bin/gcc/avr/bin/avr-gcc
COLLECT_LTO_WRAPPER=/home/joe/bin/gcc/avr/libexec/gcc/avr/4.8.1/lto-wrapper
Target: avr
Configured with: ../configure --prefix=/home/joe/bin/gcc/avr/ --with-gnu-ld
--with-gnu-as --with-dwarf2 --disable-werror --disable-threads --disable-nls
--disable-shared --disable-libssp --disable-libmudflap --disable-libgomp
--target=avr --enable-languages=c --with-system-zlib --enable-target-optspace
Thread model: single
gcc version 4.8.1 (GCC) 

Running on Linux, x86_64. avr-libc v1.8.0.

Complete test program that demonstrates the problem:
#include <stdio.h>
#include <avr/pgmspace.h>

volatile int running;

void foobar() {
    char lcdText[33];
    const char *pgmstr = running ? PSTR("Run!") : PSTR("STOP");
    snprintf(lcdText, 32, "%4S", pgmstr);
}

Description of problem:
When this is compiled with -fmerge-all-constants, a internal compiler error is
triggered. The example compiles successfully without -fmerge-all-constants.

$ avr-gcc -mmcu=atmega128 -fmerge-all-constants -c -o crap crap.c
crap.c:10:1: internal compiler error: in get_section, at varasm.c:312
 }
 ^
0x90611f get_section(char const*, unsigned int, tree_node*)
    ../../gcc/varasm.c:312
0x91da3f avr_asm_select_section
    ../../gcc/config/avr/avr.c:8368
0x90e83a assemble_variable(tree_node*, int, int, int)
    ../../gcc/varasm.c:2013
0x910205 varpool_assemble_decl(varpool_node*)
    ../../gcc/varpool.c:313
0x578478 output_in_order
    ../../gcc/cgraphunit.c:1837
0x578478 compile()
    ../../gcc/cgraphunit.c:2037
0x578689 finalize_compilation_unit()
    ../../gcc/cgraphunit.c:2119
0x4b5383 c_write_global_declarations()
    ../../gcc/c/c-decl.c:10118
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


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

end of thread, other threads:[~2015-03-29 22:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-21 23:38 [Bug c/65507] New: avr-gcc -f-merge-all-constants causes internal compiler error in get_section, at varasm.c:312 dfnsonfsduifb at gmx dot de
2015-03-22  2:22 ` [Bug c/65507] " dfnsonfsduifb at gmx dot de
2015-03-22  9:56 ` [Bug target/65507] " maltsevm at gmail dot com
2015-03-30  2:24 ` [Bug target/65507] avr-gcc -fmerge-all-constants " gjl at gcc dot gnu.org

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