News for hackers. Stuff that matters.
Re:54-line if condition in gcc's reload.c by raldi on Wednesday July 02, 2014 @01:19AM (#7975350)
It's been getting the job done for decades, in perhaps the most popular compiler of all time. I'm willing to trust the maintainers' judgement on this one.

If they'd spent all their time needlessly fixing what ain't broke, gcc would've gone the way of GNU/Hurd.

Re:54-line if condition in gcc's reload.c by MaulingMonkey on Wednesday July 02, 2014 @02:29AM (#7975538)
> It's been getting the job done for decades, in perhaps the most popular compiler of all time. I'm willing to trust the maintainers' judgement on this one.

I don't trust anyone - myself included - writing code 1/10th as convoluted, age-of-product be damned. Code is not wine, old doesn't mean good. Neither do the maintainers, methinks: Looking at blame shows some refactoring.

> If they'd spent all their time needlessly refactoring, gcc would've gone the way of GNU/Hurd.

And the lack of needful refactoring may very well send it the way of COBOL - with everyone merely wishing it had gone the way of GNU/Hurd. I've seen clang and LLVM replace gcc in both of my vendor toolchains that used gcc - suggesting they've already wished and then done something about that wish.

(Either that or licensing, but code like this stomps on the scales a bit...)

Re:54-line if condition in gcc's reload.c by mackal on Wednesday July 02, 2014 @03:52AM (#7975724)
If you've read some of the other posts, this whole file will hopefully be removed sometime in the future. For x86/x86_64 this file isn't of any use.

Edit: also reading the wiki, they are fully aware how bad this code is.

Re:54-line if condition in gcc's reload.c by richardwhiuk on Wednesday July 02, 2014 @03:14AM (#7975631)
Old code is better - it's got bug fixes.
Re:54-line if condition in gcc's reload.c by MaulingMonkey on Wednesday July 02, 2014 @06:18AM (#7976079)
> Old code is better - it's got bug fixes.

It's also got prototypes that made it into production, ball of mud designs that encourage usage bugs, and C++ thrown together by that short lived intern who took a few Java classes, wrote everything assuming there was a garbage collector around, and took great care to avoid class trees with less than 3 layers of inheritance lest he be shamed for lack of 1337ness... then topped it off with a few __try/__catch blocks to deal with that one rare crash that nobody could find a repro case for.

Re-implementing bug fixes is a toll... sometimes a very worthwhile one, though.

Re:54-line if condition in gcc's reload.c by qu4z-2 on Wednesday July 02, 2014 @10:40PM (#7981180)
To be fair, new code frequently has those attributes too.
Re:54-line if condition in gcc's reload.c by matthewmacleod on Wednesday July 02, 2014 @02:07AM (#7975485)
You could say exactly the same about OpenSSL - it's not a good argument.
Re:54-line if condition in gcc's reload.c by frozenport on Wednesday July 02, 2014 @05:10AM (#7975903)
No. A bug in OpenSSL makes the thing meaningless while in GCC it affects some corner case. I want better vectorization.
Re:54-line if condition in gcc's reload.c by MaulingMonkey on Wednesday July 02, 2014 @05:37AM (#7975989)
> while in GCC it affects some corner case

If that corner case manifests as a bug in OpenSSL, it is by definition at least as bad as a bug in OpenSSL.

Re:54-line if condition in gcc's reload.c by raldi on Wednesday July 02, 2014 @09:00AM (#7976673)
You're assuming and implying that this code is more bug-prone in its current state than it would be if it were rewritten.

I'm not convinced that's true.

Re:54-line if condition in gcc's reload.c by snogglethorpe on Wednesday July 02, 2014 @03:27AM (#7975663)
The problem of course, is that although reload very typically would work pretty well for the existing supported architectures (and optimizations etc), porting to a new architecture or changing other algorithms in the compiler would often expose problems that required extremely painful tweaking of the mess of unstated assumptions in the giant code hairball that is (was) reload... ><

LRA is by all appearances infinitely more maintainable.

Re:54-line if condition in gcc's reload.c by rdwallis on Wednesday July 02, 2014 @01:35AM (#7975393)
That's an argument from survivorship. Just because they've been successful doesn't mean this code shouldn't be improved.