From: Bernd Schmidt Date: Fri, 1 Apr 2011 17:40:27 +0000 (+0000) Subject: ifcvt.c (cond_exec_process_insns): Disallow converting a block that contains the... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c5dd277d0170878d41370afa32b10a56da8b4af6;p=gcc.git ifcvt.c (cond_exec_process_insns): Disallow converting a block that contains the prologue. * ifcvt.c (cond_exec_process_insns): Disallow converting a block that contains the prologue. * gcc.c-torture/compile/20110401-1.c: New test. From-SVN: r171840 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e9fc81a7d0f..b6ab912ae86 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -7,6 +7,9 @@ * final.c (final_start_function): Call the new function rather than using a NULL argument for dwarf2out_frame_debug. + * ifcvt.c (cond_exec_process_insns): Disallow converting a block + that contains the prologue. + 2011-04-01 Ulrich Weigand * config/spu/t-spu-elf (dp-bit.c): Use > instead of >>. diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index eee5cc724e9..3e2679923d4 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -1,5 +1,6 @@ /* If-conversion support. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, + 2011 Free Software Foundation, Inc. This file is part of GCC. @@ -304,6 +305,10 @@ cond_exec_process_insns (ce_if_block_t *ce_info ATTRIBUTE_UNUSED, for (insn = start; ; insn = NEXT_INSN (insn)) { + /* dwarf2out can't cope with conditional prologues. */ + if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_PROLOGUE_END) + return FALSE; + if (NOTE_P (insn) || DEBUG_INSN_P (insn)) goto insn_done; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9c03db42f7d..dcdf555ce22 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-04-01 Bernd Schmidt + + * gcc.c-torture/compile/20110401-1.c: New test. + 2011-03-31 Ian Lance Taylor * go.test/go-test.exp (go-set-goarch): Recognize MIPS ABIs. diff --git a/gcc/testsuite/gcc.c-torture/compile/20110401-1.c b/gcc/testsuite/gcc.c-torture/compile/20110401-1.c new file mode 100644 index 00000000000..ee83a413674 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20110401-1.c @@ -0,0 +1,22 @@ +void asn1_length_der (unsigned long int len, unsigned char *ans, int *ans_len) +{ + int k; + unsigned char temp[4]; + if (len < 128) { + if (ans != ((void *) 0)) + ans[0] = (unsigned char) len; + *ans_len = 1; + } else { + k = 0; + while (len) { + temp[k++] = len & 0xFF; + len = len >> 8; + } + *ans_len = k + 1; + if (ans != ((void *) 0)) { + ans[0] = ((unsigned char) k & 0x7F) + 128; + while (k--) + ans[*ans_len - 1 - k] = temp[k]; + } + } +}