Newsgroups: comp.arch Path: csiph.com!feeder.erje.net!1.us.feeder.erje.net!news.ripco.com!news.glorb.com!peer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border1.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 02:57:36 GMT References: <58721b88-b5b7-4ba5-b32c-06cf8a14d730@googlegroups.com> <5e72b781-4f4c-474c-93d4-e825f14da858@googlegroups.com> Organization: Kithrup Enterprises, Ld. X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Lines: 72 X-Received-Bytes: 3597 X-Received-Body-CRC: 3281827651 Xref: csiph.com comp.arch:33305 In article <5e72b781-4f4c-474c-93d4-e825f14da858@googlegroups.com>, wrote: >On Tuesday, January 26, 2016 at 5:15:03 AM UTC+2, Mike Stump wrote: >> In article <58721b88-b5b7-4ba5-b32c-06cf8a14d730@googlegroups.com>, >> wrote: >> >On Monday, January 18, 2016 at 2:15:03 PM UTC+2, Mike Stump wrote: >> >> In article <2cfa4e09-d956-4e96-8c4a-c3a144a4ebd0@googlegroups.com>, >> >> wrote: >> >> >On Thursday, January 14, 2016 at 5:01:34 PM UTC+2, Anton Ertl wrote: >> >> >For the rest of undefined behavior I prefer your attitude over that of >> >> >Mike Stump. >> >> >> >> That is the one true defined behavior of *(int*)0x1000 that we all can >> >> agree upon? >> > >> >That one is easier than most. >> >> I think you missed the point entirely. If you say, well, we can all >> agree to disagree on the semantics and the implementation will define >> them. His point isn't that he is willing to defer to the >> implementation; his point is that he will decide to the exclusion of >> all others including the implementation what the definition is. Only >> that one definition is permissible. The semantics are too important >> and can't be left to the implementation, he decides what they are to >> be. >> >> You make my point, if you defer the the implementation. >> >> What to try again? > >May be, you want to try again? Nope, I'm absolutely certain I have it right. But, I will defer to Anton on the matter. >I defined the code that compiler has to generate on you supposedly >hard "undefined" case. I am sure that Anton will agree with my >definition, as well as MSVC, icc, armcc, LLVM and even gcc.5.3 or >what is your latest release. So, please, give me more complex >example. I choose anything that Anon doesn't like about gcc. I'm led to believe that there is at least one thing he doesn't like. Since gcc does that, and since he does like it, you can only agree to like what gcc does, and in that case you don't like what Anton likes, or you agree with Anton, and then don't like what gcc does. Net, you must loose. You can only win if Anton is flawlessly happy with everything the compiler does to him, and for him. Wake me up when that happens. We can celebrate, I will buys beers, or what ever $10-$20 drink/food you like. I'd be happy to be wrong. mrs@cyclops02:/tmp$ cat t.c int i = 1; main() { if (i == 1) __builtin_unreachable (); else printf ("Hello world\n"); return 0; } mrs@cyclops02:/tmp$ gcc -w -O2 t.c mrs@cyclops02:/tmp$ ./a.out Hello world is a program for which I _think_ he would not appreciate the semantics of. Clearly, this program should not print Hello world, right? And for the __builtin_unreachable, one can substitute any undefined behavior gcc can see. gcc will do the same thing for all behavior it can figure out is undefined as I recall. So, do you like the behavior? gcc does.