Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Embeddable GCC

Name: Anonymous 2016-09-08 14:56

Is there a small version of GCC for shipping with Windows program? Because Mingw installation takes frigging gigabyte, including a lot of bloat, like C++ and fortran compiler, with useless crap, like directx bindings.

Name: Cudder !cXCudderUE 2016-09-09 11:25

It never ceases to amuse me how stupid GCC is, despite its size.

This boringly trivial function
void foo(int *x) {
(*x)++;
}


with default settings, turns into this monster:

; this isn't 16-bit --- you can use rsp too, retard
push rbp
mov rbp, rsp
; you write the first param into memory...
mov QWORD PTR [rbp-8], rdi
; ... just so you can read it back again? WTF!?
mov rax, QWORD PTR [rbp-8]
mov eax, DWORD PTR [rax]
; Let's waste another register just so we can show off
; how clever we are with the lea instruction. Idiot.
lea edx, [rax+1]
; If you were the slightest bit intelligent, you would
; not overwrite rax with the value. If you were just a
; tiny bit more so, you'd realise that it was already in
; rdi. This is terminally retarded.
mov rax, QWORD PTR [rbp-8]
mov DWORD PTR [rax], edx
; A NOP!?! What idiocy made you put one here?
nop
pop rbp
ret


It outputs a much better "inc dword [edi]" (as it should) with optimisation, but why the fuck does it even bother generating all that shit otherwise? It's like the default is "-O-3".

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List