+2017-11-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/82044
+ PR tree-optimization/82042
+ * dse.c (record_store): Check for overflow.
+ (check_mem_read_rtx): Properly check for overflow if width == -1, call
+ add_wild_read instead of clear_rhs_from_active_local_stores on
+ overflow and log it into dump_file.
+
2017-11-22 Richard Biener <rguenther@suse.de>
* gimple-iterator.c (gimple_find_edge_insert_loc): Ignore
else
width = GET_MODE_SIZE (GET_MODE (mem));
+ if (offset > HOST_WIDE_INT_MAX - width)
+ {
+ clear_rhs_from_active_local_stores ();
+ return 0;
+ }
+
if (group_id >= 0)
{
/* In the restrictive case where the base is a constant or the
else
width = GET_MODE_SIZE (GET_MODE (mem));
- if (offset > HOST_WIDE_INT_MAX - width)
+ if (width == -1
+ ? offset == HOST_WIDE_INT_MIN
+ : offset > HOST_WIDE_INT_MAX - width)
{
- clear_rhs_from_active_local_stores ();
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, " adding wild read, due to overflow.\n");
+ add_wild_read (bb_info);
return;
}