I have this line: int a = s - b * c;
s, b and c are variables. And it generates the following code
mov eax, DWORD PTR [rbp-12]
imul eax, DWORD PTR [rbp-8]
mov edx, DWORD PTR [rbp-4]
sub edx, eax
mov eax, edx
mov DWORD PTR [rbp-28], eax
Why the GCC compiler don't just do everything on EAX register in this case? Wouldn't this have the same result?
mov eax, DWORD PTR [rbp-12]
imul eax, DWORD PTR [rbp-8]
sub eax, DWORD PTR [rbp-4]
mov DWORD PTR [rbp-28], eax