From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zack Weinberg To: egcs@egcs.cygnus.com Subject: added: tests for uninit variable warnings Date: Wed, 31 Mar 1999 23:46:00 -0000 Message-ID: <199903120010.TAA03507@blastula.phys.columbia.edu> X-SW-Source: 1999-03n/msg00437.html Message-ID: <19990331234600.uiHUXx2Ttj6OE3JYkpgAoMgqa6jF-VCXcR4gljGCqGE@z> I've added to the testsuite the files gcc.dg/uninit-[1234].c. These are tests for spurious uninitialized variable warnings. uninit-1.c and uninit-3.c are understandable weaknesses in data flow analysis. uninit-2.c is slightly less understandable. It ought to recognize that rest_args cannot be nonzero on the first trip through the loop. uninit-4.c is bizarre: the warning goes away if you remove the '1' case, or if you replace 'struct operation' by an int, or even if you make 'struct operation' smaller! Also, if you take out the default case _and_ the '1' case, the warning goes away, but it shouldn't (what if cpp_lex returns 3?) The tests are marked XFAIL - all systems. I'm interested to know if they pass on anyone's machine. Note that any improvements that lead to uninit-[123] passing will probably also lead to better loop optimization. zw