extra instructions lost from -O0 to -O1

Thomas A.M. Bernard t.bernard@uva.nl
Thu Sep 11 21:35:00 GMT 2008


I guess I am missing something here. I've tried the following as Paolo 
suggested,

(define_insn "setallocate"
[(unspec_volatile:DI [(match_operand:DI 0 "general_operand" "r")]
                                 UNSPEC_ALLOCATE)]
  ""
  "allocate %0\t\t#TCB_INSTRUCTIONS" 
    [(set_attr "type" "multi")])

When flag -O0 is on, everything's fine. But when flag -O1 is engaged, 
the instruction is still omitted. Something missing ?

Thomas

Paolo Bonzini wrote:
> Thomas A.M. Bernard wrote:
>   
>> I have tried unspec_volatile without success though. As
>> follow,
>>
>> (define_insn "setallocate"
>>    [(setallocate
>>            (unspec_volatile:DI [ (match_operand:DI 0 "general_operand"
>> "r")]
>>                                        UNSPEC_ALLOCATE)
>>    )]
>>  ""
>>  "allocate %0\t\t#TCB_INSTRUCTIONS"    [(set_attr "type" "multi")])
>>     
>
> This more or less should work, except that it completely subsumes the
> SETALLOCATE rtx code that you've added.  The pattern should just be
>
>  [(unspec_volatile:DI [(match_operand:DI 0 "general_operand" "r")]
>                       UNSPEC_ALLOCATE)]
>
> Paolo
>
>   



More information about the Gcc mailing list