Re: [fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-15 Thread Rainer Stratmann
On Sonntag, 14. April 2019 21:35:43 CEST wkitt...@windstream.net wrote: > On 4/14/19 7:28 AM, Rainer Stratmann wrote: > > On Samstag, 13. April 2019 22:30:55 CEST Alexey Tor. wrote: > >> E.g. i have a loop which test each s[i] char for several cases: 'a', > >> 'b', 'c'. > >> > >> for i:= 1 to leng

Re: [fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-15 Thread Sven Barth via fpc-pascal
Am 15.04.2019 um 09:06 schrieb Bernd Oppolzer: Am 15.04.2019 um 08:29 schrieb Tomas Hajny: On Mon, April 15, 2019 07:52, Bernd Oppolzer wrote:   .   . On Samstag, 13. April 2019 22:30:55 CEST Alexey Tor. wrote:   .   . Can FPC optimize it so it only reads s[i] once (to register), not 3 times?

Re: [fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-15 Thread Bernd Oppolzer
Am 15.04.2019 um 08:29 schrieb Tomas Hajny: On Mon, April 15, 2019 07:52, Bernd Oppolzer wrote: . . On Samstag, 13. April 2019 22:30:55 CEST Alexey Tor. wrote: . . Can FPC optimize it so it only reads s[i] once (to register), not 3 times? . . True for New Stanford Pascal: .

Re: [fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-14 Thread Tomas Hajny
On Mon, April 15, 2019 07:52, Bernd Oppolzer wrote: . . >>> On Samstag, 13. April 2019 22:30:55 CEST Alexey Tor. wrote: . . Can FPC optimize it so it only reads s[i] once (to register), not 3 times? . . > True for New Stanford Pascal: . . I fail to see how is this related to FPC

Re: [fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-14 Thread Bernd Oppolzer
Am 15.04.2019 um 03:35 schrieb wkitt...@windstream.net: On 4/14/19 7:28 AM, Rainer Stratmann wrote: On Samstag, 13. April 2019 22:30:55 CEST Alexey Tor. wrote: E.g. i have a loop which test each s[i] char for several cases: 'a', 'b', 'c'. for i:= 1 to length(s) do if (s[i]='a') or (s[i]='b')

Re: [fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-14 Thread wkitty42
On 4/14/19 7:28 AM, Rainer Stratmann wrote: On Samstag, 13. April 2019 22:30:55 CEST Alexey Tor. wrote: E.g. i have a loop which test each s[i] char for several cases: 'a', 'b', 'c'. for i:= 1 to length(s) do if (s[i]='a') or (s[i]='b') or (s[i]='c') then ... Can FPC optimize it so it only re

Re: [fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-14 Thread Bernd Oppolzer
Am 13.04.2019 um 21:55 schrieb Ralf Quint: On 4/13/2019 12:30 PM, Alexey Tor. wrote: E.g. i have a loop which test each s[i] char for several cases: 'a', 'b', 'c'. for i:= 1 to length(s) do if (s[i]='a') or (s[i]='b') or (s[i]='c') then ... Can FPC optimize it so it only reads s[i] once (to

Re: [fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-14 Thread Rainer Stratmann
On Samstag, 13. April 2019 22:30:55 CEST Alexey Tor. wrote: > E.g. i have a loop which test each s[i] char for several cases: 'a', > 'b', 'c'. > > for i:= 1 to length(s) do > > if (s[i]='a') or (s[i]='b') or (s[i]='c') then ... > > Can FPC optimize it so it only reads s[i] once (to register), no

Re: [fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-13 Thread Ralf Quint
On 4/13/2019 12:30 PM, Alexey Tor. wrote: E.g. i have a loop which test each s[i] char for several cases: 'a', 'b', 'c'. for i:= 1 to length(s) do if (s[i]='a') or (s[i]='b') or (s[i]='c') then ... Can FPC optimize it so it only reads s[i] once (to register), not 3 times? How about writin

[fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-13 Thread Alexey Tor.
E.g. i have a loop which test each s[i] char for several cases: 'a', 'b', 'c'. for i:= 1 to length(s) do if (s[i]='a') or (s[i]='b') or (s[i]='c') then ... Can FPC optimize it so it only reads s[i] once (to register), not 3 times? -- Regards, Alexey __