Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Sat, 11 Jun 2005 14:33:32 -0400
From: Christopher Faylor <cgf-no-personal-reply-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: gcc 3.4.4 optimization problem (was Re: Negative stats from rsync  with 20050610 snapshot)
Message-ID: <20050611183332.GA28883@trixie.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
References: <42AA611A.2050605@acm.org> <20050611145713.GA11065@calimero.vinschen.de> <42AB16FA.4000701@familiehaase.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <42AB16FA.4000701@familiehaase.de>
User-Agent: Mutt/1.5.8i

On Sat, Jun 11, 2005 at 06:53:14PM +0200, Gerrit P. Haase wrote:
>Corinna Vinschen wrote:
>>Gerrit, could you please follow up on this?  It seems the simplest way is
>>to just switch off -funit-at-a-time for the -O2 optimization.  This is the
>>patch we applied internally, if that's of any help for you:
>>
>>Index: gcc/opts.c
>>===================================================================
>>RCS file: /cvs/cvsfiles/gcc/opts.c,v
>>retrieving revision 1.3
>>diff -c -3 -p -r1.3 opts.c
>>*** gcc/opts.c  16 Mar 2004 01:43:58 -0000      1.3
>>--- gcc/opts.c  23 Jul 2004 14:03:41 -0000
>>*************** decode_options (unsigned int argc, const
>>*** 564,570 ****
>>        flag_delete_null_pointer_checks = 1;
>>        flag_reorder_blocks = 1;
>>        flag_reorder_functions = 1;
>>-       flag_unit_at_a_time = 1;
>>      }
>>
>>    if (optimize >= 3)
>>--- 564,569 ----
>>
>>Otherwise, do you know by any chance, if there exists some fix for that
>>problem?  The above kludge is almost a year old, so there's a chance
>>that somebody already found the fix.
>
>Where we had a problem was with -fschedule-insns2
>(flag_schedule_insns_after_reload):
>
>On Aug 18 15:27:41, Corinna wrote:
>> Ich habe jetzt getestet und herausgefunden, dass durch simples
>> Abschalten der -fschedule-insns2 alles so funktioniert wie es soll.
>> Das gilt sowohl fuer cygserver, als auch fuer OpenSSH-3.9p1.
>
>I remember that I applied some patch for this, I think I missed it
>this time.  However, I hope this is fixed with gcc-3.4.x.
>
>Regarding unit-at-a-time I cannot remember right now if there was
>discussion, there are known issues with this option, anyway I will
>apply your kludge since I have not much time, I'm on a business trip
>the next two weeks.

I did a little more debugging on this and it seems like, in this case at
least, the problem is that the newlib code is wrong.  Compiling it with
-Wstrict-aliasing revealed a problem.  Correcting the strict aliasing problem
seems to make rsync work better.  There are also two other strict error
warnings in newlib which I'll fix.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

