Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!caip!brl-adm!brl-smoke!brl-sem!ron From: ron@brl-sem.ARPA (Ron Natalie ) Newsgroups: net.lang.c Subject: Re: More extensions to C Message-ID: <263@brl-sem.ARPA> Date: Sun, 1-Jun-86 02:50:28 EDT Article-I.D.: brl-sem.263 Posted: Sun Jun 1 02:50:28 1986 Date-Received: Fri, 20-Jun-86 04:06:47 EDT References: <1483@mmintl.UUCP> <856@bentley.UUCP> Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 21 In article <856@bentley.UUCP>, kwh@bentley.UUCP (KW Heuer) writes: > > >(BTW, a really good optimizing compiler can optimize out the temporary. I'm > >not fully up on what optimizers are doing these days, but I doubt that there > >are many compilers which do this. Optimizing it out is easier if it is > >declared locally ("{int temp = x; x = y; y = temp;}") instead of being > >declared at the top of the routine.) > > Unfortunately, I think the "clue" gets lost before the optimizing phase. > Eh? Unless you have a machine that has an exchange operator, the compiler is going to have to allocate a temporary anyhow. I can't see yow a compiler could generate better code for x,,y than what most compilers (even before optimization do for {register temp =x; x=y; y=temp}. -Ron INEWS SUCKS INEWS SUCKS INEWS SUCKS INEWS SUCKS