Compiler optimization involves adapting a compiler to reduce run-time or object size or both. This can be accomplished using compiler arguments (i.e. CFLAGS, LDFLAGS), compiler plugins (DEHYDRA for instance) or direct modifications to the compiler (such as modifying source code).
2
votes
0answers
69 views
gcc-arm Compiler produce different object file for the same source file
Using the GCC compiler for ARM (windows) :
arm-none-eabi-gcc.exe (Sourcery CodeBench Lite 2012.09-63) 4.7.2 version
I have got different object file produced every ~5 times i compiled the same ...
2
votes
0answers
112 views
Why does the compiler not schedule or eliminate instructions optimally?
I wanted to know how good the compiler does on optimizing assignments of structs and I did some testing with surprising results. (I would like to address this question to GCC.)
In particular I was ...
2
votes
0answers
132 views
Can we cross compile latest Linux kernel (3.0.1 or higher) with -O0 flag?
I am trying to compile Linux kernel with -O0 flag for debugging (to disable optimization like inline functions support in GCC otherwise I am getting random jumps/holes in stack-frames).
I did some ...
1
vote
0answers
45 views
Creating pointer to the sub arrays of mass allocated one dimensional array and release VC++ build
This is my first post I hope I am not making any mistake.
I have the following code. I am trying to allocate and access a two dimensional array in one shot and more importantly in one byte array. I ...
1
vote
0answers
68 views
equivalent of pgcc “-Minfo=” flag for gcc compiler?
I just discovered the nice "-Minfo=" flag in pgcc, which outputs all the optimizations that the compiler is making.
IE:
pgcc -c -pg -O3 -Minfo=all -Minline -c -o example.o example.c
run:
55, ...
1
vote
0answers
16 views
Compiler Optimization
Should live variable analysis be performed before or after loop invariant elimination? I think it should be performed after loop invariant elimination, but cant justify.
1
vote
0answers
120 views
I got 'duplicate section' errors when compiling boost_regex with size optimization (-Os)
compiler: http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.7.2/32-bit/threads-posix/sjlj/x32-4.7.2-release-posix-sjlj-rev6.7z
boost: ...
1
vote
0answers
116 views
G++ makes smaller binary than GCC after C++ compatibility changes, but slightly larger than the prior binary?
I made some changes to a C codebase so that it could compile under G++. Seems to be working, with some annoyances and the hack of -fpermissive -fshort-wchar.
Out of curiosity I compared the stripped ...
1
vote
0answers
215 views
GCC optimization options for AMD Opteron 4280: benchmark
We're moving from one local computational server with 2*Xeon X5650 to another one with 2*Opteron 4280... Today I was trying to launch my wonderful C programs on the new machine (AMD one), and ...
1
vote
0answers
167 views
Suppressing instruction reordering in the WindRiver (Diab) Compiler
I am searching for the proper and accepted way to inhibit instruction reordering in the WindRiver C compiler (AKA Diab C (?)). The problem is that I have to write hardware registers several times ...
1
vote
0answers
204 views
Is there a reason why NOT to force 8-byte alignment for complex float type?
This is a follow-up for this question.
We have an implementation of GCC for our embedded architecture. As such we have control over some aspects of the compiler and optimizer. Such aspect may be ...
1
vote
0answers
137 views
compiler optimization
What are the general ways to define and detect redundant array bounds checks in the programming code?
1
vote
0answers
613 views
GCC -O2 with -march / -ftree-vectorize
I am trying out several compiler switches against a program that performs sobel kernel convolution on two images( 2000Hx3000W and 6800Hx8500W ). There are some observations that I am not able to ...
0
votes
0answers
31 views
Corrupted Profile Info with g++ and CMake
I'm trying to optimize a fairly complex C++ project (multiple source files, linked to Boost libraries, GSL and OpenCV) using profiling. Using CMake, I first compile with
set(CMAKE_CXX_FLAGS " -O3 ...
0
votes
0answers
27 views
Bitshifting by negative Value results in the Opposite Shift!! Anywhere Defined in Some Document
I found a way this should be a optimized way. But it should be buggy too.
In a way its not portable for Arm (could be ?).
So in Gcc (3.4.4) I found that Left shifting a number by a negative value is ...