diff mbox

[1/6] Disallow predicating the prologue

Message ID 4D8A0786.4060509@codesourcery.com
State New
Headers show

Commit Message

Bernd Schmidt March 23, 2011, 2:45 p.m. UTC
With prologues appearing in blocks other than the entry block, ifcvt can
decide to predicate them. This is not a good idea, as dwarf2out will
blow up trying to handle predicated frame-related things.


Bernd
* ifcvt.c (cond_exec_process_insns): Disallow converting a block
	that contains the prologue.

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

Comments

Jeff Law March 31, 2011, 1:12 p.m. UTC | #1
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/23/11 08:45, Bernd Schmidt wrote:
> With prologues appearing in blocks other than the entry block, ifcvt can
> decide to predicate them. This is not a good idea, as dwarf2out will
> blow up trying to handle predicated frame-related things.
OK.
jeff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNlH2qAAoJEBRtltQi2kC7BP0H/jB4AxLO9QsXlFdHcsM0j9Kd
UG8NL+orqkfL3mxH+LTw5SkpovgSKf2n8NzTeJoe6xA2wHcPcVdI9or8AdnsUdg1
aW9qXTACw7CLa5f/7mPj/3XSSzw+Ub42lbSkt2o/dZBjizI8z2EPdDXduAxne5aL
BZCKi56Sg47g+B1UB2F9S6DFA6VL+Qiv+GJqPQw1Bfd6OQxpfircAr4ZB60I9TwN
1hCy3tOUxugA1cfs/U5UJKbM18kEnjcX13R1PthWvzow/xhYSwaITwD3eo5dX/ps
L2uCK5FBSKCHBrd9NRxTTpK75yAdyh+wLFpPHcmHJXsfrFwFuXjqqO+9sydyTlM=
=s6Dp
-----END PGP SIGNATURE-----
H.J. Lu April 1, 2011, 6:59 p.m. UTC | #2
On Wed, Mar 23, 2011 at 7:45 AM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> With prologues appearing in blocks other than the entry block, ifcvt can
> decide to predicate them. This is not a good idea, as dwarf2out will
> blow up trying to handle predicated frame-related things.
>

One of your changes breaks GCC bootstrap:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48403
Bernd Schmidt April 1, 2011, 8:33 p.m. UTC | #3
On 04/01/2011 08:59 PM, H.J. Lu wrote:
> On Wed, Mar 23, 2011 at 7:45 AM, Bernd Schmidt <bernds@codesourcery.com> wrote:
>> With prologues appearing in blocks other than the entry block, ifcvt can
>> decide to predicate them. This is not a good idea, as dwarf2out will
>> blow up trying to handle predicated frame-related things.
>>
> 
> One of your changes breaks GCC bootstrap:
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48403

I bootstrapped and tested on i686-linux, so it would be useful if you
could narrow it down.


Bernd
diff mbox

Patch

Index: gcc/ifcvt.c
===================================================================
--- gcc.orig/ifcvt.c
+++ gcc/ifcvt.c
@@ -304,6 +304,10 @@  cond_exec_process_insns (ce_if_block_t *
 
   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: gcc/testsuite/gcc.c-torture/compile/20110322-1.c
===================================================================
--- /dev/null
+++ gcc/testsuite/gcc.c-torture/compile/20110322-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];
+	}
+    }
+}