develooper Front page | perl.perl5.porters | Postings from July 2010

Re: [perl #76438] peephole optimiser could prune more dead code

Thread Previous | Thread Next
David Golden
July 12, 2010 04:07
Re: [perl #76438] peephole optimiser could prune more dead code
Message ID:
On Mon, Jul 12, 2010 at 12:51 AM, Eric Brine <> wrote:
> On Sun, Jul 11, 2010 at 10:22 PM, David Golden <> wrote:
>> I'm suggesting that we disclaim any implicit guarantee that the
>> compiler won't optimize away expressions that have side effects when
>> evaluated.
> Without that guarantee,
> my $x = f()
>    or DEBUG && warn(...);
> return $x;
> would be buggy. Dunno if that matters

I said "... have side effects when evaluated ..." but your example has
a side effect (functional call) in an assignment before the logic
expression.  Maybe "evaluated" isn't the right term, but I was
intending it to mean the action of reading a value from a variable.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About