This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
gcse.c bug fix
- To: gcc-patches at gcc dot gnu dot org
- Subject: gcse.c bug fix
- From: Nick Burrett <nick at dsvr dot net>
- Date: Wed, 12 Jan 2000 09:49:42 GMT
Hi,
The following patch stops gcse from deferencing a NULL pointer when
get_condition (loop.c) returns 0.
Cheers,
Nick.
Wed Jan 12 09:39:22 2000 Nick Burrett <nick.burrett@btinternet.com>
* gcse.c (delete_null_pointer_checks_1): Cope when
get_condition cannot determine the condition.
*** gcse.c.orig Wed Jan 12 09:34:31 2000
--- gcse.c Wed Jan 12 09:33:13 2000
*************** delete_null_pointer_checks_1 (block_reg,
*** 5131,5136 ****
--- 5131,5140 ----
/* LAST_INSN is a conditional jump. Get its condition. */
condition = get_condition (last_insn, &earliest);
+ /* If we can't determine the condition then skip. */
+ if (! condition)
+ continue;
+
/* Is the register known to have a nonzero value? */
if (!TEST_BIT (nonnull_avout[bb], block_reg[bb] - npi->min_reg))
continue;