Commit f1a675e4 by Andrew Haley Committed by Andrew Haley

re PR tree-optimization/79943 (Loop splitting breaks with loops of pointer type)

2017-03-08  Andrew Haley  <aph@redhat.com>

	PR tree-optimization/79943
	* tree-ssa-loop-split.c (compute_new_first_bound): When
	calculating the new upper bound, (END-BEG) should be added, not
	subtracted.

From-SVN: r245974
parent 2ff555ff
2017-03-08 Andrew Haley <aph@redhat.com>
PR tree-optimization/79943
* tree-ssa-loop-split.c (compute_new_first_bound): When
calculating the new upper bound, (END-BEG) should be added, not
subtracted.
2017-03-08 Jakub Jelinek <jakub@redhat.com>
* config/avr/avr.md (setmemhi): Make sure match_dup
......
2017-03-08 Andrew Haley <aph@redhat.com>
PR tree-optimization/79943
* gcc.dg/tree-ssa/pr79943.c: New test.
2017-03-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/79920
......
/* { dg-do run } */
/* { dg-options "-O2 -fsplit-loops -fdump-tree-lsplit-details" } */
/* { dg-require-effective-target int32plus } */
#ifdef __cplusplus
extern "C" void abort (void);
#else
extern void abort (void);
#endif
typedef struct {
int n;
} region_t;
void set (region_t *region) __attribute__((noinline));
void doit (region_t *beg, region_t *end, region_t *limit)
__attribute__((noinline));
region_t regions[10];
void
set (region_t *region) {
region->n = 1;
}
void
doit (region_t *beg, region_t *end, region_t *limit) {
for (region_t *cur = beg; cur < end; cur++) {
if (cur < limit) {
set(cur);
}
}
}
int
main (void) {
doit(&regions[0], &regions[2], &regions[10]);
if (regions[1].n != 1)
abort();
}
......@@ -436,7 +436,6 @@ compute_new_first_bound (gimple_seq *stmts, struct tree_niter_desc *niter,
if (POINTER_TYPE_P (TREE_TYPE (guard_init)))
{
enddiff = gimple_convert (stmts, sizetype, enddiff);
enddiff = gimple_build (stmts, NEGATE_EXPR, sizetype, enddiff);
newbound = gimple_build (stmts, POINTER_PLUS_EXPR,
TREE_TYPE (guard_init),
guard_init, enddiff);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment