diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/shrink-wrap.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/pr61278_0.c | 30 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/pr61278_1.c | 13 |
5 files changed, 60 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b878cb6..3cadcfa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,8 @@ -ChangeLog: +2014-05-26 Zhenqiang Chen <zhenqiang.chen@linaro.org> + + PR rtl-optimization/61278 + * shrink-wrap.c (move_insn_for_shrink_wrap): Check df_live. + 2014-05-26 Zhenqiang Chen <zhenqiang.chen@linaro.org> PR rtl-optimization/61220 diff --git a/gcc/shrink-wrap.c b/gcc/shrink-wrap.c index 6863502..7d9c6e7 100644 --- a/gcc/shrink-wrap.c +++ b/gcc/shrink-wrap.c @@ -213,8 +213,15 @@ move_insn_for_shrink_wrap (basic_block bb, rtx insn, if (EDGE_COUNT (bb->succs) == 1) return false; + /* If DF_LIVE doesn't exist, i.e. at -O1, just give up. */ + if (!df_live) + return false; + next_block = split_edge (live_edge); + /* We create a new basic block. Call df_grow_bb_info to make sure + all data structures are allocated. */ + df_grow_bb_info (df_live); bitmap_copy (df_get_live_in (next_block), df_get_live_out (bb)); df_set_bb_dirty (next_block); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5157ad8..810cc44 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2014-05-26 Zhenqiang Chen <zhenqiang.chen@linaro.org> + * gcc.dg/lto/pr61278_0.c: New test. + * gcc.dg/lto/pr61278_1.c: New test. + +2014-05-26 Zhenqiang Chen <zhenqiang.chen@linaro.org> + * gcc.dg/pr61220.c: New test. * gcc.dg/shrink-wrap-loop.c: Disable for x86_64 -m32 mode. diff --git a/gcc/testsuite/gcc.dg/lto/pr61278_0.c b/gcc/testsuite/gcc.dg/lto/pr61278_0.c new file mode 100644 index 0000000..36cdabc --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr61278_0.c @@ -0,0 +1,30 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options { { -flto -O0 } } } */ +/* { dg-extra-ld-options " -flto -O1 " } */ + +static unsigned int +fn1 (int p1, int p2) +{ + return 0; +} + +char a, b, c; + +char +foo (char *p) +{ + int i; + for (b = 1 ; b > 0; b++) + { + for (i = 0; i < 2; i++) + ; + for (a = 1; a > 0; a++) + { + char d[1] = { 0 }; + if (*p) + break; + c ^= fn1 (fn1 (fn1 (0, 0), 0), 0); + } + } + return 0; +} diff --git a/gcc/testsuite/gcc.dg/lto/pr61278_1.c b/gcc/testsuite/gcc.dg/lto/pr61278_1.c new file mode 100644 index 0000000..1162aed --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr61278_1.c @@ -0,0 +1,13 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options { { -flto -O1 } } } */ + +extern char foo (char *); + +char d; + +int +main () +{ + foo (&d); + return 0; +} |