Newsgroups: comp.arch Path: csiph.com!feeder.erje.net!2.us.feeder.erje.net!weretis.net!feeder6.news.weretis.net!news.glorb.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!kithrup.com!mrs From: mrs@kithrup.com (Mike Stump) Subject: Re: The freedom that give us C++ and C Message-ID: Date: Sat, 30 Jan 2016 00:51:17 GMT References: <9c80cae7-494e-41ed-b2eb-3eff523719f9@googlegroups.com> <2016Jan29.150758@mips.complang.tuwien.ac.at> Organization: Kithrup Enterprises, Ld. X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Lines: 101 Xref: csiph.com comp.arch:33302 In article <2016Jan29.150758@mips.complang.tuwien.ac.at>, Anton Ertl wrote: >mrs@kithrup.com (Mike Stump) writes: >>In article <9c80cae7-494e-41ed-b2eb-3eff523719f9@googlegroups.com>, >>Bruce Hoult wrote: >>>On Tuesday, January 26, 2016 at 5:00:03 AM UTC+3, Mike Stump wrote: >>>> >Because you can't write a useful C program without relying on "undefined >>>> >behavior". >>>> While maybe you can't, that deficiency is your, not mine. I can write >>>> one just fine. >Or maybe gcc has, contrary to your claim, >0 places where undefined >behaviour can happen given the right input. I think you need to improve your reading skills. Please re-read the quoted text and learn the words, you can't write a useful C program without relying upon undefined behavior mean. We have, it is called gcc. We don't rely upon any defefined behavior. This is by definition. This is a project choice, and it is true by definition, because that is just how we have chosen to manage and run the project. Compare the statement, gcc relies upon bugs in the compiler. Yes, gcc has those. But, there is no mandate to reject patches to fix bugs. We don't rely upon bugs in the compiler. If you are still completely lacking in the use of English, try these two instead: My sending email relys upon electricity and my computer. My sending email relys upon my hands being not washing in the past minute. If we remove electricit and my computer, I can't send email. This is a proper use of the term rely. In the second, the term rely isn't proper, as I can wash my hands, and still manage to use the computer, even though, most of the time I use the computer, my hands have not been washed in the past minute. There are things called dictionaries that can help with the complex words like rely. rely - be unable to manage without I think that might help you. Does that help you understand the word rely? >We just don't know these places yet. There cannot be any. We have decided that we will not rely upon undefined behavior. Any use of undefined behavior is a bug, not a reliance. >|Both GCC and Clang provide a set of fine-grained >|workaround options to explicitly disable certain optimizations, >|with which security checks that involve undefined behavior are >|not optimized away. Figure 9 summarizes these options and >|how they are adopted by four open-source projects to disable >|optimizations that caused bugs. The Linux kernel uses all >|these workarounds to disable optimizations, the FreeBSD ker- >|nel and PostgreSQL keep some of the optimizations, and the >|Apache HTTP server chooses to enable all these optimizations >|and fix its code instead. > >SPEC told you to fix your compiler when you introduced an >"optimization" that miscompiled their benchmark, and you actually did >(at least for the case occuring in SPEC CPU), because gcc is a >benchmark compiler. Actually useful programs don't get that >preferential treatment from you. Apache isn't SPEC. PostfresSQL isn't SPEC. Useful programs get preferential treatment all the time. My canonical example for one would be -fpermissive. It was only to cater to dusty deck code while (hopefully) they fixed their code base. You are merely ignorant. My god, take a look at -fno-toplevel-reorder, and try and puzzle why it is in the compiler. Preferential treatment to actual, useful programs. -ffor-scope is another. -std=gnu90 is another. -ffixed-@var{reg} is another. -funsigned-char is another. Just look through the option list and the pragma list. The list is really, really long. Now, I agree, it is annoying to do that, and to have to do that. Life goes on. We generally don't like doing that. Most of the time, we just tell users to fix their code. But, if you examine the entire code base, you can find all sorts of nuggets like this. Oh, and SPECINT is a actual, useful program. You personally, just don't think it is. Others disagree with you. For example, it is useful to try and ensure that code-gen quality in the compiler doesn't regress when compiling gcc. It is used to reject patches that would slow down compilation of gcc. Why, because patches that slow code down, are not always good. You seem to have have hate in your heart so much so, that you are unable to see clearly that which lies before you or that which people will slowly and patiently explain to you. Do you now understand why SPECINT is useful? If no, say it with me, gcc compile speed. Do you understand why compile speed is useful?