Bug 62084 - [avr] ICE: in convert_debug_memory_address
Summary: [avr] ICE: in convert_debug_memory_address
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: addr-space, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2014-08-10 17:00 UTC by Joerg Wunsch
Modified: 2023-12-05 12:38 UTC (History)
2 users (show)

See Also:
Host:
Target: avr
Build:
Known to work:
Known to fail:
Last reconfirmed: 2014-09-12 00:00:00


Attachments
Preprocessed source triggering the issue (4.04 KB, text/plain)
2014-08-10 17:00 UTC, Joerg Wunsch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joerg Wunsch 2014-08-10 17:00:46 UTC
Created attachment 33286 [details]
Preprocessed source triggering the issue

When compiling the SVN version of avr-libc, I get the following ICE:

% env LANG=C avr-gcc -gdwarf-2 -Wall -W -Wstrict-prototypes -mmcu=avr2 -mcall-prologues -Os -S strftime.i
../../../libc/time/strftime.c: In function 'pgm_copystring':
../../../libc/time/strftime.c:56:1: internal compiler error: in convert_debug_memory_address, at cfgexpand.c:2528
 pgm_copystring(const char __memx * p, unsigned char i, char *b, unsigned char l)
 ^
no stack trace because unwind library not available
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

This can also be observed with GCC 4.8.3.

Omitting the -gdwarf-2 option makes the issue go away.
Comment 1 Georg-Johann Lay 2014-08-21 11:41:54 UTC
Looks like PR52472, are your sources up to date?
Comment 2 Georg-Johann Lay 2014-09-12 14:31:25 UTC
CC'ing Jeff as he also fixed PR52472...

ICE with Jörg's code for 4.9.2and 5.0 (from 2014-09-12 SVN 215212)
Comment 3 Georg-Johann Lay 2014-12-15 18:31:23 UTC
Marek, would you give a pointer for why this is a target issue and what the backend should do to fix it?  Thanks.
Comment 4 Marek Polacek 2014-12-15 18:54:29 UTC
Looking at this again, this might be a "debug" issue instead rather than "target".
Comment 5 Senthil Kumar Selvaraj 2015-01-02 13:09:09 UTC
Not reproducible with the latest trunk build (gcc version 5.0.0 20150102)
Comment 6 Richard Biener 2023-12-05 12:38:13 UTC
With checking it ICEs like the following, IIRC there's a duplicate for this,
we add a duplicate name attribute with address-spaces.

> ./cc1 -quiet t.c -gdwarf-2
../../../libc/time/strftime.c:43:1: internal compiler error: in add_dwarf_attr, at dwarf2out.cc:4501
0xfc2317 add_dwarf_attr
        /space/rguenther/src/gcc/gcc/dwarf2out.cc:4501
0xfc29ed add_AT_string
        /space/rguenther/src/gcc/gcc/dwarf2out.cc:4773
0xfeb303 add_name_attribute(die_struct*, char const*)
        /space/rguenther/src/gcc/gcc/dwarf2out.cc:21240
0xfd7280 modified_type_die
        /space/rguenther/src/gcc/gcc/dwarf2out.cc:14031
0xfd658a modified_type_die
        /space/rguenther/src/gcc/gcc/dwarf2out.cc:13806
0xfedb2e add_type_attribute
        /space/rguenther/src/gcc/gcc/dwarf2out.cc:22364
0xfee904 gen_array_type_die
        /space/rguenther/src/gcc/gcc/dwarf2out.cc:22631
0xff9a20 gen_type_die_with_usage
        /space/rguenther/src/gcc/gcc/dwarf2out.cc:26394
0xff9de1 gen_type_die
        /space/rguenther/src/gcc/gcc/dwarf2out.cc:26457
0xffbef6 gen_decl_die
        /space/rguenther/src/gcc/gcc/dwarf2out.cc:27136
0xffd2d4 dwarf2out_decl
        /space/rguenther/src/gcc/gcc/dwarf2out.cc:27655