mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-21 15:50:50 +08:00
re PR middle-end/60482 (Loop optimization regression)
PR middle-end/60482 * tree-vrp.c (register_edge_assert_for_1): Don't add assert if there are multiple uses, but op doesn't live on E edge. * tree-cfg.c (assert_unreachable_fallthru_edge_p): Also ignore clobber stmts before __builtin_unreachable. * gcc.dg/vect/pr60482.c: New test. From-SVN: r208506
This commit is contained in:
parent
33a9145bb7
commit
b24ca895d7
@ -1,3 +1,11 @@
|
||||
2014-03-12 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR middle-end/60482
|
||||
* tree-vrp.c (register_edge_assert_for_1): Don't add assert
|
||||
if there are multiple uses, but op doesn't live on E edge.
|
||||
* tree-cfg.c (assert_unreachable_fallthru_edge_p): Also ignore
|
||||
clobber stmts before __builtin_unreachable.
|
||||
|
||||
2014-03-11 Richard Sandiford <rdsandiford@googlemail.com>
|
||||
|
||||
* builtins.c (expand_builtin_setjmp_receiver): Use and clobber
|
||||
|
@ -1,3 +1,8 @@
|
||||
2014-03-12 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR middle-end/60482
|
||||
* gcc.dg/vect/pr60482.c: New test.
|
||||
|
||||
2014-03-11 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/60389
|
||||
|
20
gcc/testsuite/gcc.dg/vect/pr60482.c
Normal file
20
gcc/testsuite/gcc.dg/vect/pr60482.c
Normal file
@ -0,0 +1,20 @@
|
||||
/* PR middle-end/60482 */
|
||||
/* { dg-do compile } */
|
||||
/* { dg-additional-options "-Ofast" } */
|
||||
/* { dg-require-effective-target vect_int } */
|
||||
|
||||
double
|
||||
foo (double *x, int n)
|
||||
{
|
||||
double p = 0.0;
|
||||
int i;
|
||||
x = __builtin_assume_aligned (x, 128);
|
||||
if (n % 128)
|
||||
__builtin_unreachable ();
|
||||
for (i = 0; i < n; i++)
|
||||
p += x[i];
|
||||
return p;
|
||||
}
|
||||
|
||||
/* { dg-final { scan-tree-dump-not "epilog loop required" "vect" } } */
|
||||
/* { dg-final { cleanup-tree-dump "vect" } } */
|
@ -410,9 +410,9 @@ assert_unreachable_fallthru_edge_p (edge e)
|
||||
if (gsi_end_p (gsi))
|
||||
return false;
|
||||
stmt = gsi_stmt (gsi);
|
||||
if (is_gimple_debug (stmt))
|
||||
while (is_gimple_debug (stmt) || gimple_clobber_p (stmt))
|
||||
{
|
||||
gsi_next_nondebug (&gsi);
|
||||
gsi_next (&gsi);
|
||||
if (gsi_end_p (gsi))
|
||||
return false;
|
||||
stmt = gsi_stmt (gsi);
|
||||
|
@ -5423,12 +5423,9 @@ register_edge_assert_for_1 (tree op, enum tree_code code,
|
||||
return false;
|
||||
|
||||
/* We know that OP will have a zero or nonzero value. If OP is used
|
||||
more than once go ahead and register an assert for OP.
|
||||
|
||||
The FOUND_IN_SUBGRAPH support is not helpful in this situation as
|
||||
it will always be set for OP (because OP is used in a COND_EXPR in
|
||||
the subgraph). */
|
||||
if (!has_single_use (op))
|
||||
more than once go ahead and register an assert for OP. */
|
||||
if (live_on_edge (e, op)
|
||||
&& !has_single_use (op))
|
||||
{
|
||||
val = build_int_cst (TREE_TYPE (op), 0);
|
||||
register_new_assert_for (op, op, code, val, NULL, e, bsi);
|
||||
|
Loading…
x
Reference in New Issue
Block a user