Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bad optimisations: (Was: Test version zsh-3.1.6-test-1)
- X-seq: zsh-workers 7168
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: Bad optimisations: (Was: Test version zsh-3.1.6-test-1)
- Date: Fri, 16 Jul 1999 10:56:36 +0200 (MET DST)
- In-reply-to: mason@xxxxxxxxxxxxxxx's message of 16 Jul 1999 08:26:13 GMT
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
mason@xxxxxxxxxxxxxxx wrote:
> Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx> typed:
> :Geoff Wing wrote:
> :> What about just expanding it slightly (with appropriate comments of course)
> :> instead of duplicating it.
> :> e.g.
> :> if (*args && **args == '?')
> :> args++;
> :> /* default result parameter */
> :> if (*args)
> :> reply = *args++;
> :> else
> :> reply = ops['A'] ? "reply" : "REPLY";
> :Note this isn't intended as an optimisation (of course), but to work
> :around a bug in gcc-2.8.1 under DU.
>
> I thought it may be a gcc optimisation bug. i.e. Does it appear at -O0 or
> -01 or -O2? All of them?
Yes, it is. The problem is in the first two lines of the code
above. If there is only the `args++' in the `then'-branch, `args'
contains a random value after the `if'. This happens with all
optimisation levels, so I guess it's a register allocation problem in
the backend.
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author