------- Comment #3 from ebotcazou at gcc dot gnu dot org 2007-02-16 11:08 ------- It's a variant of a bug you fixed
2005-12-16 Jakub Jelinek <[EMAIL PROTECTED]> PR rtl-optimization/24899 * loop.c (strength_reduce): Don't reduce giv that is not always computable and where add_val or mult_val can trap. The discrepancy is that the giv is a DEST_ADDR instead of a DEST_REG and /* The v->always_computable field is used in update_giv_derive, to determine whether a giv can be used to derive another giv. For a DEST_REG giv, INSN computes a new value for the giv, so its value isn't computable if INSN insn't executed every iteration. However, for a DEST_ADDR giv, INSN merely uses the value of the giv; it does not compute a new value. Hence the value is always computable regardless of whether INSN is executed each iteration. */ if (type == DEST_ADDR) v->always_computable = 1; else v->always_computable = ! not_every_iteration; $4 = {insn = 0x556e6cd0, new_reg = 0x0, src_reg = 0x55753a00, giv_type = DEST_ADDR, dest_reg = 0x55753b20, location = 0x5575e3dc, mode = SImode, mem = 0x5575e3d8, mult_val = 0x556db230, add_val = 0x5575e384, benefit = 24, final_value = 0x0, combined_with = 1, replaceable = 1, not_replaceable = 0, ignore = 0, always_computable = 1, always_executed = 0, maybe_multiple = 0, cant_derive = 0, maybe_dead = 0, auto_inc_opt = 0, shared = 0, no_const_addval = 1, lifetime = 2, derive_adjustment = 0x0, ext_dependent = 0x0, next_iv = 0x8662cf8, same = 0x0, same_insn = 0x0, last_use = 0x0} The fix is probably to test v->always_executed instead. -- ebotcazou at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- BugsThisDependsOn| |24899 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30787