This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [PATCH] Fix PR35609, spurious "is" used uninitialized warning


On 3/18/08 1:53 PM, Richard Guenther wrote:

2008-03-18 Richard Guenther <rguenther@suse.de>

	PR middle-end/35609
	* tree-ssa.c (always_executed): New global flag.
	(warn_uninitialized_var): If !always_executed warn with "maybe"
	instead of "is".
	(execute_early_warn_uninitialized): Compute post-dominators.
	Initialize always_executed before processing each basic block.

	* gcc.dg/testsuite/uninit-15.c: New testcase.
	* gcc.dg/testsuite/uninit-16.c: Likewise.

OK with


+ + static bool always_executed;

I would rather carry this into the walk_tree recursion via 'data'. I'm actually a bit surprised we haven't run into this one earlier. But these warning are not very strong, so I guess I shouldn't be.


--- 1432,1441 ----
      case SSA_NAME:
        /* We only do data flow with SSA_NAMEs, so that's all we
  	 can warn about.  */
!       if (always_executed)
!         warn_uninit (t, "%H%qD is used uninitialized in this function", data);
!       else
!         warn_uninit (t, "%H%qD maybe used uninitialized in this function", data);

s/maybe/may be/



Diego.



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