Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 26883
Product:  
Component:  
Status: NEW
Resolution:
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Ned Konz <ned@bike-nomad.com>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 26883 depends on: Show dependency tree
Show dependency graph
Bug 26883 blocks:

Additional Comments:





Mark bug as waiting for feedback
Mark bug as suspended




View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2006-04-30 04:23 Opened: 2006-03-27 07:31
The following (perhaps questionable) code causes an ICE in in
set_mem_attributes_minus_bitpos, at emit-rtl.c:1539

compile command line:
avr-g++ -mmcu=atmega128 -c -o romproblems.o romproblems.cpp

program:

#define PROGMEM __attribute__((__progmem__))

struct ROMVar1
{
    int const val;
    ROMVar1(int const& init) : val(init) { }
};

ROMVar1 PROGMEM rv1b(123);

------- Comment #1 From Richard Guenther 2006-03-27 08:09 -------
We ICE in

      if (base && DECL_P (base)
          && TREE_READONLY (base)
          && (TREE_STATIC (base) || DECL_EXTERNAL (base)))
        {
          tree base_type = TREE_TYPE (base);
          gcc_assert (!(base_type && TYPE_NEEDS_CONSTRUCTING (base_type))
                      || DECL_ARTIFICIAL (base));
          MEM_READONLY_P (ref) = 1;

Now, it is indeed questionable to put a non-POD into ro memory.  So I think
this is INVALID - but let's see what others think.

------- Comment #2 From Andrew Pinski 2006-03-27 08:12 -------
(In reply to comment #1)
> We ICE in
> Now, it is indeed questionable to put a non-POD into ro memory.  So I think
> this is INVALID - but let's see what others think.

The target should have rejected progmem and not placed const on the decl.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug