From patchwork Wed Jan 25 20:10:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Assume PATTERN is always non-NULL in sched-deps.c (PR middle-end/51986) Date: Wed, 25 Jan 2012 10:10:42 -0000 From: Jakub Jelinek X-Patchwork-Id: 137853 Message-Id: <20120125201042.GE18768@tyan-ft48-01.lab.bos.redhat.com> To: Vladimir Makarov Cc: gcc-patches@gcc.gnu.org Hi! This PR is about a warning that rev may be used uninitialized when sched_get_condition_with_rev_uncached is inlined into its caller. It in fact may be used uninitialized if PATTERN (insn) is ever NULL. But IMNSHO everything in the compiler assumes that PATTERN of an insn is always non-NULL, so IMHO instead of just moving the if (rev) *rev = false; hunk above the test we should just remove this test. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2012-01-25 Jakub Jelinek PR middle-end/51986 * sched-deps.c (sched_get_condition_with_rev_uncached): Don't test for pat == 0. Jakub --- gcc/sched-deps.c.jj 2011-12-01 11:45:06.000000000 +0100 +++ gcc/sched-deps.c 2012-01-25 15:27:49.523165701 +0100 @@ -521,9 +521,6 @@ sched_get_condition_with_rev_uncached (c rtx pat = PATTERN (insn); rtx src; - if (pat == 0) - return 0; - if (rev) *rev = false;