GCC 4.9 To See Significant Upgrades In 2014
noahfecks writes "It seems that the GCC developers are taking steps to roll out significant improvements after CLANG became more competitive. 'Among the highlights to look forward to right now with GCC 4.9 are: The Undefined Behavior Sanitizer has been ported to GCC; Ada and Fortran have seen upgrades; Improved C++14 support; RX100, RX200, and RX600 processor support; and Intel Silvermont hardware support.'"
Perhaps it should be banged on a bit before worrying about 4.9.x as it takes a while before everyone starts using the bleeding edge gcc.
You are being MICROattacked, from various angles, in a SOFT manner.
Perhaps in json?
http://michaelsmith.id.au
What features do you want to use that's not currently exposed by their incomplete c99 implementation?
Most projects don't use C99 anyway.
So your defense is that gcc users don't use features unimplemented in gcc?
That's good, because you'll have to wait until next year anyway.
The Tao of math: The numbers you can count are not the real numbers.
Why does your subject imply that boon means the opposite of "a thing that is helpful or beneficial"?
No Apple is pushing CLANG for exactly the reason that they want to use BSD license in a take not give fashion...how hackable is it; Xcode(SDK) will only work on Mac OS X. Looking forward to proprietary extensions :)
Huh? Apple is putting a lot of work in llvm (the general compiler framework), and they give that work away under the BSD license. They are most certainly not only taking, they are also giving a lot. llvm is highly portable, and is certainly not restricted to Mac OS X (or C/C++ compilation, for that matter). In fact, lots of BSD distributions (and Minix) use llvm as their compiler of choice, because they don't want GPLed software. Similarly, clang (the c/c++ compiler on top of llvm) is highly portable, under a BSD license, and Apple is putting a lot of work in it. Moreover, Apple is eating its own dog food, and using llvm/clang to compile most of Mac OS X, which is a solid guarantee for the quality of the resulting compiler, and is therefore another highly significant contribution.
It is true that Xcode (the Integrated Development Environment (IDE)) is not free, but that does not diminish the contributions that Apple is making to llvm and clang.
... 1101 days ago
ICWUDT (a guy who modded you up doesn't, though).
Three years is such a short period in software development, and nothing ever changes in development strategy! Even the quote mentions already included at that time "GIMPLE and friends", so it seems even if Stallman didn't want them there, he failed to prevent it.
Do troll harder.
PS: "boon" - this word doesn't mean what you think it means.
...which is exactly why some folks are flocking to CLANG.
People are flocking to CLANG for a variety of reasons. A large part seems to be because for some reason the GNU tools have become deeply unfashionable.
LLVM has some structural advantages (due to being youger), but despite that all, GCC is comfortable keeping ahead of CLANG in both the optermizer and C++ support, so it cant be that bad.
Sure, not everyone wants to extend/modify his compiler, but actively preventing people from reusing your code isn't exactly what you should do if you want to keep a community thriving.
RMS is but one voice on the steering committee. He can say what he wants (and does), but the committee doesn't have to listen.
That sad, when taking the long term into account, his whacky ranting and raving has the sad tendency to come true.
SJW n. One who posts facts.
I'm not sure whether I understood your post correctly as it seems to garbled be yes? If you doubt that RMS is objecting plugins in GCC then you're apparently new to /. and GCC.
BTW: not just Apple is pushing CLANG (and thereby LLVM), other companies include NVIDIA (CUDA uses LLVM) and IBM (CLANG was ported to Blue Gene/Q), just to name a few.
Computer simulation made easy -- LibGeoDecomp
If you're trying to imply that Java is the new Fortran you couldn't be more wrong.
It's the new C080L.
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
Yeah, because I feel so cozy in the company of Apple, Nvidia and IBM. Still I miss sorely Oracle, Adobe, Sony, Microsoft, the RIIAA and... how was that Myhrvold fixture called? Ah, yes! Intellectual Ventures.
Technically LLVM is shiny and all, but I won't touch it with a ten-foot pole.
I always think Apple's biggest stake in CLANG (or any competition to GCC) is Jobs's butthurt from good ol' NeXT times.
With some insight into how some people write real high-quality enterprise grade software, I can confidently state that you are completely clueless. In addition, many enterprises that are critically depending on IT infrastructure are now considering replacing Solaris with Linux (RHEL typically), due to problems with basically _everything_ Oracle makes. And of course the most critical part of RHEL (the kernel) is compiled with GCC.
You are suffering from the common misconception that things you pay for are better. Psychologically well researched, but it does not hold up in reality, and is just a specific form of stupidity, i.e. ignoring reality to take comfort in your own misconceptions.
Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
The above post was correctly marked as flamebait, but there's a grain of truth in it. ICC, for example, still does a much better job at vectorisation than gcc or clang (clang with polly enabled does about as well, significantly better in some cases). The autoparallelisation stuff in the Sun, uh, Oracle, compiler is also pretty impressive on certain workloads.
I am TheRaven on Soylent News
As to the quality of the error messages, I recently fixed a number of bugs in some third party code that were raising warnings with clang. One warning, that a comparison was the result of a comparing an unsigned value as being less than zero, occurred in four string processing loops in the code. In each case, it was iterating over characters in a user-provided string and appeared to be a security hole. Fixing it was trivial (change the type to a signed integer), but I like it when my compiler points out serious bugs in code that I'm compiling.
I am TheRaven on Soylent News
Aehm, care to give an example? It also been well-known for a long time that if you want to debug code generated by GCC you should use -O0 (at often not that much performance loss...), as with higher optimizations parts of your code and variables may well be missing in the code. In fact, GDB even warns you about this in startup.
Now, that said, did this change the timing characteristics or the actual computation performed? Because if it just changed the timing, then you are too stupid to read the documentation and use -O0 and all your vitriol is misdirected. If it changed the function, example please and make sure to file a bug-report.
Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
GPL does one very important thing well: it keeps the community alive. As long as people are modifying GPL code, they're obliged to contribute those modifications back.
The problem with the BSD license is, as soon as Apple feels they have the market sewn up, those patches are going to stop flowing very quickly and probably not for the most rational reasons - remember, it's managers and executives who make these decisions, not coders.
What do people have to say about the IBM XL C++ compiler? Is it good?
There's an interesting Clang talk at Channel9: The Care and Feeding of C++’s Dragons. Speaker: Chandler Carruth, Clang lead, Google.
but there's a grain of truth in it.
Not really.
ICC, for example, still does a much better job at vectorisation than gcc or clang
So? gcc has much better support for C++11 and C++14, and supports many more architectures and platforms. ICC being better at one (important, but still one) aspect does not make the claim that "gcc is a hobbyist tool" have a grain of truth.
GCC runs a substantial fraction of the world's infrastructure: it is in absolutely no way a hobbyist tool.
SJW n. One who posts facts.
C11 is more important, and also fixed so it is compatible with C++. Don't expect any C++ compilers to support the bad parts of C99.
>GCC is comfortable keeping ahead of CLANG in both the optermizer and *C++ support*, so it cant be that bad.
Um. No it isn't. Clang finished c++14 support a few weeks ago. Dev builds of gcc aren't there yet.
GCC is not just a C compiler, but a compiler collection (GCC = GNU Compiler Collection), which especially contains the C compiler gcc (= GNU C Compiler), and in addition the C++ compiler g++.
The Tao of math: The numbers you can count are not the real numbers.
That should have been: "... not just a C++ compiler, ..."
Reminder to self: Preview!
The Tao of math: The numbers you can count are not the real numbers.
As a member of both the C and C++ standards committees, and as a CEO of a company that sells C++ libraries to businesses for high-performance computing, I have to disagree with you.
The Oracle/Sun and IBM compilers are the worst C++ compilers available.
Intel is also pretty bad, despite touting good standards conformance and being designed for runtime speed, it deals very badly with abstraction penalties, and is extremely slow to compile.
Microsoft's compiler is also pretty bad, both at compilation speed, standards conformance, and runtime speed, with each new version introducing quirks and regressions (they have acknowledged major codegen regressions in the recent releases and are investigating them)
If you want a good C++ compiler, GCC or Clang are the only tools available.
It's so good that you should use the experimental Clang port instead or the outdated GCC whenever you can.
Wrong. I can modify gcc in whatever way I want without ever giving anyone the changed code. The only restriction is that if I decide to give anyone the modified code, I have to do so under the terms of the GPL. But as long as I keep it for myself (e.g. using a modified gcc to compile my own programs), nobody forces me to provide the modifications to anyone.
The Tao of math: The numbers you can count are not the real numbers.
Apple created and owns clang. If they wanted to stop distributing the source, they could do so no matter if it were GPL and BSD licensed. It's theirs to do what they want with.
They're giving it all away for free with zero obligation to do so, and all you can do is criticise them for somehow still not giving enough?
Well, if it is undefined, there cannot be any information about it, right? ;-)
The Tao of math: The numbers you can count are not the real numbers.
As far as C++(11,14) goes, clang is more mature, faster *and* it produces faster code (the last mainly due to libc++). I fail to see how is GCC keeping ahead, let alone comfortably. Also, clang is a self-hosting C++ compiler -- unlike gcc, which is written in C. That helps an awful lot.
PS: Getting a two-fold speedup when going from libstdc++ to libc++ (with STL-heavy code) is not unheard of. But yes, that's anecdotal. I don't have any good benchmarks, as far as anything like that even exists.
You claim "badly broken", yet you provide zero evidence. I suspect that you did something emphatically not covered by any sane use of the C language (and by the language specification) and that you did shoot yourself in the foot. "Dirty tricks" are never acceptable and never needed. If you really have to go that low-level, use embedded assembler. Never use dirty tricks for things that embedded assembler would have solved cleanly, that is just plain incompetent. And never expect a compiler to compile something in a specific way, that is _not_ what a compiler is for! The compiler is free to compile in any way it sees fit, as long as the language specification is respected.
So, my conclusion at this time is that you did something really stupid and now blame others for it. Pathetic.
Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
Essentially.
Not to mention the fact that the higher optimization levels are not ever guaranteed to produce correct code... many optimizations are only possible under assumptions that cannot be guaranteed at compile time, but are taken for granted to be the case at runtime. Perhaps the simplest such assumptions is that functions that take two input pointers do not encounter cases where those two pointers point to the same memory in a way that could break register usage optimizations.
"His name was James Damore."
No, not at all. If you modify GPL software you don't have to contribute anything. If you distribute the changed software then you must make available the source code to the people you have distributed the binary to, and you must license it in a way that is compatible with the GPL. So if I take GCC,fix some bugs, and sell it I must give my customers the source code I have created. I must license it to them with terms that allow them to distribute it freely, so long as they continue to follow the GPL when they distribute it. I am under no obligation to give it away to the world for free, however I can not stop my customers from doing so.
Yes, "much better", going by available data. Here's that table with version numbers converted into dates. I deleted rows with missing data for either compiler, and removed other compilers. If I get bored, I might actually go through their changelogs for missing data.
https://docs.google.com/spreadsheet/pub?key=0AsJ4G9Bsq42ddHRjbmJNbldUbWxFckpITTFQUkVJUUE&output=html
Apple "created" clang by hiring the LLVM creator. It was started in academia.
That's great that they have color diagnostics. When will they finally fully support a standard from 14 years ago?
Looks like it's supported now.
Why can an open source group manage to implement C99, when a giant company in Redmond has trouble?
"First they came for the slanderers and i said nothing."
There problems are arquitectural and modular. It is easier to write a back end or front end for CLANG and it has better API support for integration into IDEs. That is by design. GCC was written at a time when that was not a consideration although it could have been. I guess RMS was never a big fan of programming in C/C++ otherwise Emacs might have had an extensions for that at a point...
As long as people are modifying GPL code, they're obliged to contribute those modifications back.
The above isn't true -- it's perfectly legal to modify GPL code all you want and never contribute your modifications to anyone.
What you can't do is distribute the resulting binaries without also giving the modified source code code to the recipients of those binaries.
The problem with the BSD license is, as soon as Apple feels they have the market sewn up, those patches are going to stop flowing
I doubt it, but even if they did, so what? Someone else could (and would) continue development where Apple left off.
I don't care if it's 90,000 hectares. That lake was not my doing.
The language standard spells out the rules which assumptions the compiler can make and which it cannot make. If the compiler makes only assumptions the standard allows it to make, the code violating those assumptions is already broken, and therefore the compiler cannot break it. If the compiler makes assumptions the standard doesn't allow it to make, the compiler is broken. Therefore except for bugs in the compiler, the higher optimization levels are guaranteed to produce correct code from correct source.
If that happens in a case where the relevant standard doesn't allow this assumption, get the compiler fixed. If that happens in a case where the relevant standard allows this assumption, fix your code. In no case does the optimization break correct code.
The Tao of math: The numbers you can count are not the real numbers.
No Apple is pushing CLANG for exactly the reason that they want to use BSD license in a take not give fashion...how hackable is it; Xcode(SDK) will only work on Mac OS X.
GPL didn't stop Xcode existing when it operated around gcc. Xcode will always be an OS X thing, it has nothing to do with the back end compiler license.
Yes, they get a lot of mileage out of tightly coupling Xcode with llvm - eg: they don't have to write the same level of context sensitive language support for editing when you can do constant incremental compiling and inspect the state of the compiler's trees.
BTW; Apple use LLVM for far more than just Xcode. They used it in the display subsystem to run-time optimize code to the actual machine's display configuration.
Being GPLv3 is a bonus for Apple, but it's about more than that. Competition is a good thing.
gcc moved to c++ recently.
Actually since 4.8, the correct optimization level to use for debugging is now -Og
From the documentation at http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
-Og Optimize debugging experience. -Og enables optimizations that do not interfere with debugging. It should be the optimization level of choice for the standard edit-compile-debug cycle, offering a reasonable level of optimization while maintaining fast compilation and a good debugging experience.
The only benches I've seen are from phoronix, and that showed a hit or miss result, largely dependent on the application compiled. You claim it's faster, then state you don't have any benches to prove it? Why did you bother posting?
if GCC wants to survive they are going to have to dump their unfree license and adopt one that is more business friendly. at the rate people are dumping GCC now only hobbyists will be using it in 5 years.
Yes, every person on Earth must dedicate their lives to corporate profit. All hail the corporate masters. We are but slaves to do your bidding. Down with freedom. Down with people. All hail the corporations!
It's crazy expensive. But it's good. It's the most typical compiler for BlueGene machines, for example. But you can buy a few gcc licenses for the same price.
You can buy an infinite number of GCC licenses for the same price, unless you mean something other than "a right to use the software" by "license". Do you mean "a few GCC support contracts"?
Aren't you about 40 years too late to be flabbergasted by an optimizing compiler?
Okay the Apple patches stop flowing in. What happens then? Will the CLANG compiler stop working? Will the source code suddenly disappear for other developers? Will all other companies, academics and users stop developing LLVM? Hint: No, no, no. LLVM isn't an Apple project unlike Phoronix and some other claim, nor is it equal with CLANG. It is an open source toolset developed by different companies, academics and individuals.
Sigh.. you are wrong.. not about the compiler producing code outside of spec with higher optimization levels.. you are wrong that the compiler is "broken" if it makes these assumptions, because of command line switches such as increased optimization levels are telling it to make them.
Optimizations are a desirable thing even when they might sometimes violate the ideas of the abstract machine that the language defines. Thats not "broken" -- thats "giggity!"
"His name was James Damore."
It means he knows more about what he is talking about than most of the commenters here.
As the other guy says, Apple created clang from scratch. You are confusing it with LLVM, which is its backend.
Because, you know... funding developers on an open source project and releasing the fuits of their labor for free is all take, take, take.
I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
Can you give a specific example? I've seen such claims come up before, but so far it has always amounted to someone not being aware of exactly what the spec says about assumptions, in which case it is their code's fault that the optimization changed the result. If they wrote the code correctly, it would work, and in either case the compiler is up to spec. For example, some of the problems people have in C with not aliasing pointers correctly, the compiler is following the spec when it does what people might not expect at higher optimization.
The only restriction is that if I decide to give anyone the modified code, I have to do so under the terms of the GPL.
Almost. The GPL requires you to provide the source to any derivative binary you distribute. So you're right, Apple could compile OSX with its own derivative of GCC and not have to release the source to that GCC derivative. However, they cannot ship a derivative of GCC with Xcode and not provide the source to it.
boldly going forward, 'cause we can't find reverse
Why does self-hosting help an awful lot?
boldly going forward, 'cause we can't find reverse
If it's enabled by a speciality flag which documents the violation of the standard, then it's not broken. But if it's enabled by a generic -On option, I consider the compiler broken. And if the compiler doesn't explicitly document that the flag makes it non-conforming (yes, the documentation is part of the compiler, although it is not part of the executable), then the compiler is broken as well.
The Tao of math: The numbers you can count are not the real numbers.
The binary is definitely code (indeed, it's the actual code). Therefore if I distribute a modified binary, I distribute modified code. Therefore that case is included in what I wrote.
The Tao of math: The numbers you can count are not the real numbers.
It's just that I'm sceptical about the news value of what gcc is *planning* to do next year. It's nice to hear that they actually have a road map, but I think that a thorough evaluation of what they have actually released would be more interesting.
E.g. a thorough and up-to-date comparison of gcc object code quality, quality of optimisations, quality of vectorisation, clarity of error messages, errors caught at compile time, speed of compilation with those of other compilers. Like Intel's compiler, Microsoft's compiler, and Clang.
Now that would be useful I think. Not stories about their road map. But that's just me.
Man, I never thought I'd see "bare metal language" and C++ in the same sentence.
BITS 16
start:
mov ax, 07C0h ; Set up 4K stack space after this bootloader
add ax, 288 ; (4096 + 512) / 16 bytes per paragraph
mov ss, ax
mov sp, 4096
mov ax, 07C0h ; Set data segment to where we're loaded
mov ds, ax
mov si, text_string ; Put string position into SI
call print_string ; Call our string-printing routine
jmp $ ; Jump here - infinite loop!
text_string db 'This is my cool new OS!', 0
print_string: ; Routine: output string in SI to screen
mov ah, 0Eh ; int 10h 'print char' function
lodsb ; Get character from string
cmp al, 0
je
int 10h ; Otherwise, print it
jmp
ret
times 510-($-$$) db 0 ; Pad remainder of boot sector with 0s
dw 0xAA55 ; The standard PC boot signature
"Preventing" is a bit misleading. If you trust what the people in that link say (and I'm not sure I do), it seems like they were making it harder to implement some of the intermediate functionality (but not "preventing"). However, since everything in GCC is publicly viewable (as the entire project is GPLv3), even this strikes me as a bit odd. There's nothing preventing anyone from forking GCC and implementing those changes if they wish. GCC code is and has always been reusable under the terms of at least some version of the GPL.
They could rename it GNC - GNC's Not a Compiler - in the same spirit that GNU was named ;-)
Huh? Apple is putting a lot of work in llvm (the general compiler framework), and they give that work away under the BSD license. They are most certainly not only taking, they are also giving a lot. llvm is highly portable, and is certainly not restricted to Mac OS X (or C/C++ compilation, for that matter). In fact, lots of BSD distributions (and Minix) use llvm as their compiler of choice, because they don't want GPLed software . Similarly, clang (the c/c++ compiler on top of llvm) is highly portable, under a BSD license, and Apple is putting a lot of work in it. Moreover, Apple is eating its own dog food, and using llvm/clang to compile most of Mac OS X, which is a solid guarantee for the quality of the resulting compiler, and is therefore another highly significant contribution.
I'm curious - other than FreeBSD & Minix, has anyone else adapted LLVM/Clang as their compiler of choice? OpenBSD has forked a previous GCC version where it was last GPL2. How about NetBSD & DragonFly? I know that Minix has adapted LLVM/Clang, though.
Has Oracle/Sun also adapted LLVM/Clang for Solaris, or are they staying w/ GCC? How about IBM in AIX, or HP in HP/UX?
Actually, people who take BSDL code usually contribute patches back to the trunk to avoid the hassle of maintaining a separate fork, and that, rather than a GPL license, encourages the desired behavior. Even if Apple gets the market sewn up, one can always take the last open version and fork it. It's exactly what happened w/ OpenSolaris => OpenIndiana, when Oracle decided to yank the former. (The reason that didn't take off is that the main platform of Solaris - SPARC - is unsupported by OpenIndiana, and there are a plethora of Unixes for x86/x64)
On a separate note, have people added support for other languages on this platform? Such as LLVM/ObjectiveC, LLVM/Java, LLVM/C#, LLVM/____ (fill in a language of your choice)?
I'm trying to think of a file system that is GPL3 - can't think of one. ZFS is CDDL. Ext4 and XFS is GPLv2, as is just about everything else. Is there anything that could be a file system to, say, HURD, whenever it's ready?
The main poison pill in GPL3 in case of Apple is the patent indemnity clause in GPL3, which gives rights to any Apple patent invoked in the design of the software to everyone downstream. In GPL2, it wasn't a big deal since that was not explicitly stated, so that in case any Apple IP did get invoked, they could work it out w/ a customer, and even exempt them if needed. But explicitly granting blanket patent rights to everybody is what made not just Apple, but a lot of other companies wary about GPL3. That's also why Apple dropped Samba and decided to do their own implementation of it, unburdened by GPLv3
Has Oracle/Sun also adapted LLVM/Clang for Solaris, or are they staying w/ GCC?
If you mean "as their official compiler", the answer to both questions is "no"; they have, instead, Sun^WOracle Solaris Studio's compilers. If you mean "in their package system", they could offer both, but currently only appear to offer GCC 3 and GCC 4.5.
How about IBM in AIX,
If you mean "as their official compiler", the answer to both questions is "no"; they have, instead, IBM XL C/C++.
or HP in HP/UX?
If you mean "as their official compiler", the answer to both questions is "no"; they have, instead, HP C/aC++.
I meant 'as their official compiler'. Thanks for the response
I get it... if the optimization flags is specifically "-O#" then its bad because you have amazingly decided that "-O#" is a special "generic" flag.
I got news for ya: Just because you are used to using a particular flag because its not been a problem for you so far, that does not make it special or "generic."
"His name was James Damore."
Can you give a specific example?
With GCC, -O2 enables strict aliasing and thus makes assumptions (sometimes incorrect) about what types of pointers might point to the same memory locations, and it makes these assumptions so that it can produce better code.
"His name was James Damore."
No you'd be violating the GPL because the gcc source code is not machine-code only. You would be obliged to prove you only ever hex edited the binaries.
Sure, everything is possible with BSD, but it requires a lot more good will to keep it going - the default when private companies get involved is not that they have to contribute back and you leave open this massive opportunity for the managers and executives of the programmers involved to say "no we don't want you sending out those modifications" (itself, a problem for those programmers since they can't build up that public credit).
With GPL, since there's no choice, the problem is closed - no one has to be convinced.
Say you have a product that you're distributing as free software, but it's of such quality that it doesn't need much paid technical support. So how do you cover the cost of keeping a roof over your head while you develop this product?
I did not claim that I'd be allowed to distribute the binary without source. Rather I claimed that if I distribute the binary, then I distribute code, and therefore I'm then bound to the GPL which then requires me to give also the source.
Please read more carefully.
The Tao of math: The numbers you can count are not the real numbers.
I did not claim that I'd be allowed to distribute the binary without source. Rather I claimed that if I distribute the binary, then I distribute code, and therefore I'm then bound to the GPL which then requires me to give also the source.
Please read more carefully.
You know we're actually in agreement, but you're using exceptionally obtuse language to make your point. Please communicate more clearly.