c++/1983: compiler tells me to submit a bug report for static const declaration.
coleenp@east.sun.com
coleenp@east.sun.com
Wed Feb 14 10:16:00 GMT 2001
>Number: 1983
>Category: c++
>Synopsis: compiler tells me to submit a bug report for static const declaration.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Feb 14 10:16:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Coleen Phillimore
>Release: gcc 2.96
>Organization:
>Environment:
Linux i486
>Description:
/*
This program barfs. Take out the "const" in the static
member declaration and it works.
% g++ -c gccbug.cpp
gccbug.cpp: In function `const c1_RegMask c1_RegMask::empty_set ()':
gccbug.cpp:20: Unrecognizable insn:
(insn 15 9 16 (set (reg:SI 43)
(mem/s/u (symbol_ref:SI ("_10c1_RegMask._empty_set")) 0)) -1 (nil)
(nil))
gccbug.cpp:20: Internal compiler error in extract_insn, at recog.c:2106
Please submit a full bug report.
See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.
*/
class BlockItem;
class BlockBegin {
BlockItem* _block_item;
public:
BlockItem* block_item() const { return _block_item; }
};
class c1_RegMask {
private:
int _mask;
static int _size;
static const c1_RegMask _empty_set;
public:
static const c1_RegMask empty_set() { return _empty_set; }
void print () const;
};
class BlockItem {
public:
c1_RegMask _lockout;
public:
c1_RegMask lockout () const { return _lockout; }
};
class ValueGen {
public:
void block_prolog(BlockBegin* block);
};
void ValueGen::block_prolog(BlockBegin* block) {
BlockItem* block_item = block->block_item();
c1_RegMask lockout = (block_item != __null ? block_item->lockout() : c1_RegMask::empty_set());
}
>How-To-Repeat:
g++ -c <attached source>.cpp
>Fix:
Whenever. I'll work around it (I hope).
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list