diff options
author | Andreas Krebbel <Andreas.Krebbel@de.ibm.com> | 2009-09-17 07:52:40 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2009-09-17 07:52:40 +0000 |
commit | 10e154dfd7e4e61f1205a364d07ec0789c85bfd3 (patch) | |
tree | 4514b02eb3f66a3122257eb620cf2f322e1a4902 /gcc | |
parent | bbc1e3ba53a28e618d2763b19c16c60621148b01 (diff) | |
download | gcc-10e154dfd7e4e61f1205a364d07ec0789c85bfd3.zip gcc-10e154dfd7e4e61f1205a364d07ec0789c85bfd3.tar.gz gcc-10e154dfd7e4e61f1205a364d07ec0789c85bfd3.tar.bz2 |
cfglayout.c (fixup_reorder_chain): Accept conditional jumps without a fallthrough edge.
2009-09-17 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* cfglayout.c (fixup_reorder_chain): Accept conditional jumps
without a fallthrough edge.
2009-09-17 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* gcc.c-torture/compile/20090917-1.c: New testcase.
From-SVN: r151790
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cfglayout.c | 11 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/20090917-1.c | 55 |
4 files changed, 75 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bbbc1bb..6e4f28f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-09-17 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> + + * cfglayout.c (fixup_reorder_chain): Accept conditional jumps + without a fallthrough edge. + 2009-09-16 DJ Delorie <dj@redhat.com> * config/m32c/m32c.c (m32c_emit_epilogue): Check for R8C or M16C diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c index bc8ed8b..d6d1b3a 100644 --- a/gcc/cfglayout.c +++ b/gcc/cfglayout.c @@ -787,6 +787,17 @@ fixup_reorder_chain (void) { if (any_condjump_p (bb_end_insn)) { + /* This might happen if the conditional jump has side + effects and could therefore not be optimized away. + Make the basic block to end with a barrier in order + to prevent rtl_verify_flow_info from complaining. */ + if (!e_fall) + { + gcc_assert (!onlyjump_p (bb_end_insn)); + bb->il.rtl->footer = emit_barrier_after (bb_end_insn); + continue; + } + /* If the old fallthru is still next, nothing to do. */ if (bb->aux == e_fall->dest || e_fall->dest == EXIT_BLOCK_PTR) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1f1bc17..1a24f25 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2009-09-17 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> + + * gcc.c-torture/compile/20090917-1.c: New testcase. + 2009-09-16 Uros Bizjak <ubizjak@gmail.com> * gfortran.dg/default_format_denormal_2.f90: Add ieee options. diff --git a/gcc/testsuite/gcc.c-torture/compile/20090917-1.c b/gcc/testsuite/gcc.c-torture/compile/20090917-1.c new file mode 100644 index 0000000..2b8c371 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20090917-1.c @@ -0,0 +1,55 @@ +typedef int *loop_p; +typedef struct VEC_loop_p_base +{ + unsigned num; + loop_p vec[1]; +} +VEC_loop_p_base; + +__inline__ int +VEC_loop_p_base_iterate (const VEC_loop_p_base * vec_, unsigned ix_, + loop_p * ptr) +{ + if (vec_ && ix_ < vec_->num) + { + *ptr = vec_->vec[ix_]; + return 1; + } + else + { + return 0; + } +} + +typedef struct VEC_loop_p_heap +{ + VEC_loop_p_base base; +} +VEC_loop_p_heap; + + +static __inline__ int +am_vector_index_for_loop (VEC_loop_p_heap * loop_nest, int loop_num) +{ + int i; + loop_p l; + + for (i = 0; + VEC_loop_p_base_iterate ((loop_nest) ? &(loop_nest)->base : 0, i, + &(l)); i++) + if (l == loop_num) + return i; + + __builtin_unreachable (); +} + +unsigned char +build_access_matrix (unsigned max) +{ + unsigned i; + for (i = 0; i < max; i++) + { + if (am_vector_index_for_loop (foo (), 0)) + return 0; + } +} |