This is the mail archive of the gcc-help@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: execution order


At 14:41 24.09.2007 +0200, Kövesdi György wrote:
>> If the destructor is not inline, and also is not provided in that same
>
>It is used in an embedded application, and because the mentioned destructor is 
>compiled into one machine-code instruction, it would be a big wastage not to 
>inline it.
>The class mentioned in my example and the variable are refer to hardware 
>registers, which are in connection by hardware, and (of course) the accessing 
>order is important.
>Is there any possibility to tell the compiler such a dependency?

That's only a guess, I haven't tried it, but what about:
{
    class c;
    {
        other stuff;
    }
}

Shouldn't gcc then call the destructor of c after other stuff? Or can it still
reorder it if optimizing?

bye  Fabi



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