This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Spurious warnings when gcse is active.
- To: law at cygnus dot com
- Subject: Spurious warnings when gcse is active.
- From: Klaus-Georg Adams <Klaus-Georg dot Adams at chemie dot uni-karlsruhe dot de>
- Date: Fri, 12 Jun 1998 14:18:48 +0200
- Cc: egcs-bugs at cygnus dot com
Hi Jeff,
The attached file produces spuriuos warnings which seem to indicate an
error somewhere in gcse.
The minimal set of flags to produce them is
g++ -Wall -O -fgcse -frerun-loop-opt
They vanish if you change the program slightly (e.g. leave out the
enum, or replace "foo" by foo(), or leave out one of the lines... Very
strange). I have tried to boil this down as much as possible.
kga
--
-------------------------------------------------------------------------
Klaus-Georg Adams Email: Klaus-Georg.Adams@chemie.uni-karlsruhe.de
Institut f. Anorg. Chemie, Lehrstuhl II Tel: 49(0)721 608 3485
Universität Karlsruhe, D-76128 Karlsruhe
-------------------------------------------------------------------------
#include <string>
string foo();
struct a {
void bar();
enum b { c, d };
b theb;
string baz;
};
void
a::bar()
{
baz += foo() + foo();
baz += foo() + foo() + "foo";
}