avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Subject: Reordering of __builtin functions around inline asm volatile


From: Ricardo Cosme
Subject: Subject: Reordering of __builtin functions around inline asm volatile
Date: Sat, 23 Sep 2023 22:48:09 -0300
User-agent: Zoho Mail

Hi,

I have a question regarding the reordering of statements involving a builtin function and extended asm volatile expressions in avr-gcc.

Consider the following code snippet:

//C++
{
  asm volatile(/* template plus operands */);
  __builtin_avr_delay_cycles(cycles);
  asm volatile(/* template plus operands */);
}

I understand that the compiler is allowed to reorder statements as long as it doesn't affect the observable behavior of the program. However, in this specific case, the __builtin_avr_delay_cycles function is a compiler intrinsic.

Assuming there are no other expressions on the above block, is it possible for the compiler to reorder the three statements?

Cheers,
Ricardo Cosme



reply via email to

[Prev in Thread] Current Thread [Next in Thread]