This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: extra instructions lost from -O0 to -O1


"Thomas A.M. Bernard" <t.bernard@uva.nl> writes:

> 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 ?

The only that gcc will remove an unspec_volatile instruction is if it
is on a code path which is never executed.

Look at the RTL dump files (from, e.g., -fdump-rtl-all), see where it
is disappearing, and why.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]