diff options
Diffstat (limited to 'gcc/dse.c')
-rw-r--r-- | gcc/dse.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -1355,11 +1355,10 @@ record_store (rtx body, bb_info_t bb_info) } /* Handle (set (mem:BLK (addr) [... S36 ...]) (const_int 0)) as memset (addr, 0, 36); */ - else if (!MEM_SIZE (mem) - || !CONST_INT_P (MEM_SIZE (mem)) + else if (!MEM_SIZE_KNOWN_P (mem) + || MEM_SIZE (mem) <= 0 + || MEM_SIZE (mem) > MAX_OFFSET || GET_CODE (body) != SET - || INTVAL (MEM_SIZE (mem)) <= 0 - || INTVAL (MEM_SIZE (mem)) > MAX_OFFSET || !CONST_INT_P (SET_SRC (body))) { if (!store_is_unused) @@ -1384,7 +1383,7 @@ record_store (rtx body, bb_info_t bb_info) } if (GET_MODE (mem) == BLKmode) - width = INTVAL (MEM_SIZE (mem)); + width = MEM_SIZE (mem); else { width = GET_MODE_SIZE (GET_MODE (mem)); @@ -2517,7 +2516,7 @@ scan_insn (bb_info_t bb_info, rtx insn) && INTVAL (args[2]) > 0) { rtx mem = gen_rtx_MEM (BLKmode, args[0]); - set_mem_size (mem, args[2]); + set_mem_size (mem, INTVAL (args[2])); body = gen_rtx_SET (VOIDmode, mem, args[1]); mems_found += record_store (body, bb_info); if (dump_file) |