Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22148

Compiler explorer and GCC have different outputs

$
0
0

I have some C code that when given to Compiler Explorer, it outputs:

        mov     BYTE PTR [rbp-4], al
        mov     eax, ecx
        mov     BYTE PTR [rbp-8], al
        mov     eax, edx
        mov     BYTE PTR [rbp-12], al

However if I use GCC or G++ then it gives me this:

        mov     BYTE PTR 16[rbp], al
        mov     eax, edx
        mov     BYTE PTR 24[rbp], al
        mov     eax, ecx
        mov     BYTE PTR 32[rbp], al

I have no idea why the BYTE PTRs are different. They have a completely wrong address and I don't get why they are before the [rdp] part.

If you know how to reproduce the first output using gcc or g++ please help!


Viewing all articles
Browse latest Browse all 22148

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>