OSDN Git Service

* ifcvt.c (cond_exec_process_insns): Disallow converting a block
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Apr 2011 17:40:27 +0000 (17:40 +0000)
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Apr 2011 17:40:27 +0000 (17:40 +0000)
that contains the prologue.

* gcc.c-torture/compile/20110401-1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171840 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/ifcvt.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20110401-1.c [new file with mode: 0644]

index e9fc81a..b6ab912 100644 (file)
@@ -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  <Ulrich.Weigand@de.ibm.com>
 
        * config/spu/t-spu-elf (dp-bit.c): Use > instead of >>.
index eee5cc7..3e26799 100644 (file)
@@ -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;
 
index 9c03db4..dcdf555 100644 (file)
@@ -1,3 +1,7 @@
+2011-04-01  Bernd Schmidt  <bernds@codesourcery.com>
+
+       * gcc.c-torture/compile/20110401-1.c: New test.
+
 2011-03-31  Ian Lance Taylor  <iant@google.com>
 
        * 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 (file)
index 0000000..ee83a41
--- /dev/null
@@ -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];
+       }
+    }
+}