Patchwork rtl_verify_flow_info fix

login
register
mail settings
Submitter Tom de Vries
Date Sept. 6, 2011, 9:05 a.m.
Message ID <4E65E24C.8050402@codesourcery.com>
Download mbox | patch
Permalink /patch/113513/
State New
Headers show

Comments

Tom de Vries - Sept. 6, 2011, 9:05 a.m.
On 09/05/2011 02:46 PM, Jakub Jelinek wrote:
> On Mon, Sep 05, 2011 at 02:31:32PM +0200, Tom de Vries wrote:
>> --- gcc/recog.c (revision 178145)
>> +++ gcc/recog.c (working copy)
>> @@ -118,6 +118,46 @@ init_recog (void)
>>  }
>>  
>>  
>> +/* Return true if labels in asm operands BODY are LABEL_REFs.  */
>> +
>> +static bool
>> +asm_labels_ok (rtx body)
>> +{
>> +  rtx first, asmop = NULL;
>> +  int i;
> 
> asmop = extract_asm_operands (body);
> 
> if (asmop == NULL)
>   return true;
> ?
> 
> I'd say you don't need to call asm_noperands after it.

Yes, that's better.

> 
> 	Jakub

bootstrapped and regtested on x86_64, build and regtested on arm.

OK for trunk?

Thanks,
- Tom

2011-09-06  Tom de Vries  <tom@codesourcery.com>

	* recog.c (asm_labels_ok): New function.
	(check_asm_operands): Use asm_labels_ok.
Jakub Jelinek - Sept. 6, 2011, 9:17 a.m.
On Tue, Sep 06, 2011 at 11:05:16AM +0200, Tom de Vries wrote:
> bootstrapped and regtested on x86_64, build and regtested on arm.
> 
> OK for trunk?

Yes.

> 2011-09-06  Tom de Vries  <tom@codesourcery.com>
> 
> 	* recog.c (asm_labels_ok): New function.
> 	(check_asm_operands): Use asm_labels_ok.

	Jakub

Patch

Index: gcc/recog.c
===================================================================
--- gcc/recog.c (revision 178145)
+++ gcc/recog.c (working copy)
@@ -118,6 +118,25 @@  init_recog (void)
 }
 
 
+/* Return true if labels in asm operands BODY are LABEL_REFs.  */
+
+static bool
+asm_labels_ok (rtx body)
+{
+  rtx asmop;
+  int i;
+
+  asmop = extract_asm_operands (body);
+  if (asmop == NULL_RTX)
+    return true;
+
+  for (i = 0; i < ASM_OPERANDS_LABEL_LENGTH (asmop); i++)
+    if (GET_CODE (ASM_OPERANDS_LABEL (asmop, i)) != LABEL_REF)
+      return false;
+
+  return true;
+}
+
 /* Check that X is an insn-body for an `asm' with operands
    and that the operands mentioned in it are legitimate.  */
 
@@ -129,6 +148,9 @@  check_asm_operands (rtx x)
   const char **constraints;
   int i;
 
+  if (!asm_labels_ok (x))
+    return 0;
+
   /* Post-reload, be more strict with things.  */
   if (reload_completed)
     {