gcc 3.4.4 optimization problem (was Re: Negative stats from rsync with 20050610 snapshot)

Gerrit P. Haase gerrit@familiehaase.de
Sat Jun 11 18:33:00 GMT 2005


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.

 From the ChangeLog (http://gcc.gnu.org/gcc-3.4/changes.html):
===
The new unit-at-a-time compilation scheme has several compatibility issues:

     * The order in which functions, variables, and top-level asm 
statements are emitted may have changed. Code relying on some particular 
ordering needs to be updated. The majority of such top-level asm 
statements can be replaced by section attributes.
     * Unreferenced static variables and functions are removed. This may 
result in undefined references when an asm statement refers to the 
variable/function directly. In that case either the variable/function 
shall be listed in asm statement operand or in the case of top-level asm 
statements the attribute used shall be used to force function/variable 
to be always output and considered as a possibly used by unknown code.

       For variables the attribute is accepted only by GCC 3.4 and 
newer, while for earlier versions it is sufficient to use unused to 
silence warnings about the variables not being referenced. To keep code 
portable across different GCC versions, you can use appropriate 
preprocessor conditionals.
     * Static functions now can use non-standard passing conventions 
that may break asm statements calling functions directly. Again the 
attribute used shall be used to prevent this behavior.

As a temporary workaround, -fno-unit-at-a-time can be used, but this 
scheme may not be supported by future releases of GCC.
===


Gerrit
-- 
=^..^=

--
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/



More information about the Cygwin mailing list