This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Spurious warnings when gcse is active.



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";
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]