c++ - GCC 4.6.2 inlining behavior -


- snatched from chat.so -

I have a few projects on GCC 4.6.2 and Intel After profiling with Vuitton I saw that very important tasks were not underlined (or at least shown under the hotspots, which I believed would mean ineffective inline)

example Function is a re-2 numerical addition, and a transit statement

I believe it is in Windows Written, but due to profiling, it seems that they are not included in Linux under GCC 4.6.2.

I am trying to work in INC Linux (works in Windows), but it will take some time

Until then, does anyone know that GCC 4.6? 2 is that VS-2010 is different from the relatively simplified compiler optimization? I have turned on O3 in GCC

What has been motivated to do to me that it is a significant part of the code rewriting, and on Windows, the display is almost equal or slightly slower , While at least Linux is at least 2x slow.

The most informative answer will help me understand the steps needed to inline the platforms and how best will it be for this situation, as I think these things are extremely situation-specific

EDIT: Also, thinking that for business-specific reasons I was forced to paste it with GCC 4.6.2, to write this code without having to re-write it I or Can?

Thank you!

itemprop = "text">

Super clear for first completion: Are you absolutely certain that possibly non-inlineed calls Was compiled with -O3 ?

GCC and VS compiler and equipment chains are substantially different, I would not be surprised that instead of their adapter the behavior is differently.

Next I see that the Ternary operator can be very cheated. Ternary operators are almost certainly going to create a branch and potentially create constructor calls, conversions, etc. Do not assume that because it is a brief operator in C ++, the compiler will be able to produce a small code. This may prevent the compiler from optimizing. In fact, you can try repeating the turnar code in the normal if statement and see if it helps your performance at all.

Once again, when you proceed to further diagnosis, one simple thing to try is to type the string and see whether the name of the function is displayed in binary or not. If this does not happen, it is definitely underlining (although it shows that it can be strictly debugged and not the actual code). There are other tools such as nm , readelf , elfdump , and dump . You have to see which equipment is available on your platform and then try to use them to search the function (s) in question.

Another idea is to load the compiled binary in GDB, and collect it in the dis file and the row at the point where the function calls is created then you can read the disassembly code to see what the compiler did. Most codes should really be quite clear. If an actual function was called, you might see something like the call command.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -