Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #89063
| From | Vir Campestris <vir.campestris@invalid.invalid> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: What does "current time" mean? |
| Date | 2023-02-09 12:11 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <ts2nu9$lopp$1@dont-email.me> (permalink) |
| References | <tru716$3r5bl$1@dont-email.me> <FNxEL.100924$ZnFc.14325@fx41.iad> <875ycddz4w.fsf@nosuchdomain.example.com> |
On 07/02/2023 20:00, Keith Thompson wrote: > It seems to me the author encountered a compiler bug, not a flaw in the > language. That was my first thought. but then I read on... On 07/02/2023 22:16, David Brown wrote: > It would also be fine for the compiler to pre-calculate fib(42) at > compile time and skip the run-time calculation entirely. And that also seemed quite possible. So I looked at his stuff on Godbolt. It's clearly making two calls to now(), passing an address on the stack in eax to both calls. Only then does it call fib(). The odd thing is that the parameter to fib() is on the stack - and it calls fib() twice with values 41 and 40, then adds the two results together. It then does something with cout I can't be bothered to decode. I don't understand why it adds fib for 40 and 41 together either, instead of just calling it with 42. I'll go with compiler bug. Andy
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
What does "current time" mean? Manu Raju <MR@invalid.invalid> - 2023-02-07 19:00 +0000
Re: What does "current time" mean? scott@slp53.sl.home (Scott Lurndal) - 2023-02-07 19:39 +0000
Re: What does "current time" mean? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-02-07 12:00 -0800
Re: What does "current time" mean? Vir Campestris <vir.campestris@invalid.invalid> - 2023-02-09 12:11 +0000
Re: What does "current time" mean? David Brown <david.brown@hesbynett.no> - 2023-02-09 14:13 +0100
Re: What does "current time" mean? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-02-07 11:51 -0800
Re: What does "current time" mean? David Brown <david.brown@hesbynett.no> - 2023-02-07 23:16 +0100
Re: What does "current time" mean? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-09 04:19 -0800
Re: What does "current time" mean? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-09 05:27 -0800
Re: What does "current time" mean? Andrey Tarasevich <andreytarasevich@hotmail.com> - 2023-02-10 20:53 -0800
csiph-web