From 530a480063ae847a74add404586d5db4ed9bf8a8 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 8 Mar 2011 16:51:12 +0100 Subject: [PATCH] re PR debug/47881 (-fcompare-debug failure (length) with -O -fno-dce -funroll-loops -fno-web) PR debug/47881 * ira.c (ira): Call df_analyze again if delete_trivially_dead_insns removed anything. * gcc.dg/pr47881.c: New test. From-SVN: r170780 --- gcc/ChangeLog | 4 ++++ gcc/cp/ChangeLog | 1 + gcc/ira.c | 5 +++-- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.dg/pr47881.c | 24 ++++++++++++++++++++++++ 5 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr47881.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ece9ec1638e..5e14896efa0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2011-03-08 Jakub Jelinek + PR debug/47881 + * ira.c (ira): Call df_analyze again if delete_trivially_dead_insns + removed anything. + PR tree-optimization/48022 * fold-const.c (fold_comparison): Don't call fold_overflow_warning for EQ/NE_EXPR. diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index df362b29538..883175a8e33 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,6 @@ 2011-03-08 Dodji Seketeli + PR c++/47957 * name-lookup.c (binding_to_template_parms_of_scope_p): Only consider scopes of primary template definitions. Adjust comments. diff --git a/gcc/ira.c b/gcc/ira.c index 68d47fbb2d5..f2b871f0251 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -1,5 +1,5 @@ /* Integrated Register Allocator (IRA) entry point. - Copyright (C) 2006, 2007, 2008, 2009, 2010 + Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Contributed by Vladimir Makarov . @@ -3232,7 +3232,8 @@ ira (FILE *f) check_allocation (); #endif - delete_trivially_dead_insns (get_insns (), max_reg_num ()); + if (delete_trivially_dead_insns (get_insns (), max_reg_num ())) + df_analyze (); init_reg_equiv_memory_loc (); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a2ed5fd398f..d9297febc4f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,11 @@ +2011-03-08 Jakub Jelinek + + PR debug/47881 + * gcc.dg/pr47881.c: New test. + 2011-03-08 Dodji Seketeli + PR c++/47957 * g++.dg/lookup/template3.C: New test. 2011-03-08 Kai Tietz diff --git a/gcc/testsuite/gcc.dg/pr47881.c b/gcc/testsuite/gcc.dg/pr47881.c new file mode 100644 index 00000000000..ee1707342cd --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr47881.c @@ -0,0 +1,24 @@ +/* PR debug/47881 */ +/* { dg-do compile } */ +/* { dg-options "-O -fcompare-debug -fno-dce -funroll-loops -fno-web" } */ + +extern int data[]; + +int +foo (int *t, int *f, int n) +{ + int i = 0, a, b, c, d; + while (data[*f] && n) + n--; + for (; i < n; i += 4) + { + a = data[*(f++) & 0x7f]; + c = data[*(f++) & 0x7f]; + c = data[*(f++) & 0x7f]; + d = data[*(f++) & 0x7f]; + if ((a & 0x80) || (b & 0x80) || (c & 0x80) || (d & 0x80)) + return 1; + *(t++) = 16; + } + return 0; +} -- 2.30.2