Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Stupid proposal of the day:
Deliver without GCC optimization, or try with the lesser Level (O1)?
If i were you, GCC -O0 and "fuck yourself stupid compiler" -cit. -
makinet1997ySounds like a case of undefined behaviour! Compilers love to mess you up when you have undefined behaviour! Static analysers are good at warning about those, and then there's dynamic analysers for catching the bug.
-
I found it! With optimizations on GCC uses the eflags in certain cases to avoid doing extra condition branches. My assembly incorrectly cleared the zero flag in a place where it shouldn't have, causing it to go down the wrong branch, causing all sorts of bad things. All fixed 😁
Specifically GCC turned what was a simple condition jump into a test + cmovle instruction pair. Making the issue non obvious because execution of cmovle is based upon the state of the eflags -
This rant made me way too happy. It's refreshing to find someone else on here who works with assembly, instead of yet another web dev.
I've been writing a complex mutation engine that dynamically modifies compiled C++ code. Now there's alot of assembly involved, but I got it to work. I finished off writing the last unit test before it was time to port it all to windows. I switched into a release build, ready to bask in the glory of it all. FUCKING GCC OPTIMIZATIONS BROKE EVERYTHING. I had been doing all my dev in debug mode and now some obscure optimization GCC does in release mode is causing a segfault...somewhere. Just when I thought I was done 😅
undefined