Page 1 of 1
There is no rule without exception...
Posted: Tue Jan 16, 2018 2:52 am
by Solar
When you see someone doing his first post ever, let's say on StackOverflow, complaining that some code of his segfaults when compiled with optimations enabled...
How would you figure the chances that this newcomer has
actually found a bug in the compiler?
Microscopic, usually.
Well, it happens.
I found this... instructive. There is no rule without exception.
Re: There is no rule without exception...
Posted: Tue Jan 16, 2018 2:59 am
by bluemoon
I found SO reputation has nothing to do with the user ability.
In most situation you answered a tough question you got +25, while other answered a silly trivial for-loop over an array and get +200.
Parkinson's law of triviality is real.
Re: There is no rule without exception...
Posted: Tue Jan 16, 2018 3:07 am
by Solar
No, of course SO rep (or any "rep") is only a poor proxy for ability.
I was merely aiming at the old (and in one-out-of-a-million justified) saying that "it's not the compiler".
Except when it actually is. Which I thought funny, because it happens so very seldom.
Re: There is no rule without exception...
Posted: Tue Jan 16, 2018 3:29 am
by bluemoon
Compiler is so complex that it is more likely to have bug now.
I once found a bug in gcc -O3 vectorization generating nonsense code:
https://stackoverflow.com/questions/370 ... 6#37067436
And the bug report (still open):
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70976
Re: There is no rule without exception...
Posted: Tue Jan 16, 2018 4:35 am
by alexfru
Solar wrote:When you see someone doing his first post ever, let's say on StackOverflow, complaining that some code of his segfaults when compiled with optimations enabled...
How would you figure the chances that this newcomer has
actually found a bug in the compiler?
Microscopic, usually.
Well, it happens.
I found this... instructive. There is no rule without exception.
I've recently optimized a library. In the process I found a couple of compiler bugs and a kernel bug. Three too many. And I wasn't doing anything special I'd say. Just a few "interesting" coincidences. Things had worked until I hit those.
Re: There is no rule without exception...
Posted: Tue Jan 16, 2018 6:10 pm
by Korona
I found no invalid code generation bugs in GCC so far but I hit 100s of ICEs when writing heavily templated code in GCC.