This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
optimization/5547: g++ 3.1 crash in output_operand
- From: snyder at fnal dot gov
- To: gcc-gnats at gcc dot gnu dot org
- Date: Wed, 30 Jan 2002 18:19:56 -0600
- Subject: optimization/5547: g++ 3.1 crash in output_operand
- Reply-to: snyder at fnal dot gov
>Number: 5547
>Category: optimization
>Synopsis: g++ 3.1 crash in output_operand
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Wed Jan 30 16:26:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: scott snyder
>Release: 3.1 20020129 (experimental)
>Organization:
>Environment:
System: Linux karma 2.4.9-13 #1 Tue Oct 30 20:11:04 EST 2001 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../egcs/configure --prefix=/usr/local/egcs --enable-threads=posix --enable-long-long
>Description:
When the source below is compiled with optimization, debugging,
and PIC code generation all turned on, the compiler stops with
an internal error:
$ g++ -c -g -O2 -fpic x.cc
x.cc:29: output_operand: invalid expression as operand
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
>How-To-Repeat:
Compile this source with `-c -g -O2 -fpic'.
---------------------------------------------------------------------------
struct string {
char* s;
};
inline string operator+(char a, const string & b) {
string s;
s.s = new char[12];
s.s[0] = a;
return s;
}
struct hash_map {
int find(const string & key) const;
};
static const char sss[7] = "012345";
static void function(const string & name,
const hash_map & dictionary, int npar)
{
int iter = dictionary.find (sss[npar]+name);
for(int i=0; i<npar; i++) ;
}
---------------------------------------------------------------------------
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: