develooper Front page | perl.perl5.porters | Postings from December 2018

Re: [perl #133558] perl 5.26: use lib pragma issue in IBM AIX

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
December 16, 2018 12:57
Subject:
Re: [perl #133558] perl 5.26: use lib pragma issue in IBM AIX
Message ID:
20181216125707.GA4066@iabyn.com
On Sat, Dec 15, 2018 at 11:14:31PM +0100, Leon Timmermans wrote:
> The existing code is far too "smart" for its own good. I think we're
> much better off rewriting it to something more obvious like attached.

> -        assert(OPpITER_REVERSED == 2); /* so inc becomes -1 or 1 */
> -        inc = (IV)1 - (IV)(PL_op->op_private & OPpITER_REVERSED);
> +        inc = PL_op->op_private & OPpITER_REVERSED ? -1 : 1;

The existing code is specifically written to avoid a branch (and thus a
possible CPU stall point) in a very hot bit of code. There are comments
directly above the line explaining what it does, and an assertion.
The fact that it failed due to a compiler bug shouldn't be a reason to
eliminate it.

-- 
The warp engines start playing up a bit, but seem to sort themselves out
after a while without any intervention from boy genius Wesley Crusher.
    -- Things That Never Happen in "Star Trek" #17

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About