public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/32358]  New: Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels
@ 2007-06-15 16:49 rob1weld at aol dot com
  2007-06-15 16:53 ` [Bug other/32358] " rob1weld at aol dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: rob1weld at aol dot com @ 2007-06-15 16:49 UTC (permalink / raw)
  To: gcc-bugs

Acovea - Analysis of Compiler Options via Evolutionary Algorithm 
http://www.coyotegulch.com/products/acovea/index.html

Acovea implements a genetic algorithm to find the "best" options for compiling
programs with the GNU Compiler Collection (GCC) compiler. It has both command
line and GTK GUI.

Acovea can determine the GCC compiler flags and options neccesary to produce a
program with:

 * Fastest runtime
 * Smallest size
 * A specific return value

Traditional function-level profiling identifies the algorithms most influential
in a program's performance; Acovea is then applied to those algorithms to find
the compiler flags and options that generate the fastest code. Acovea is also
useful for finding pessimistic combinations of options, and for testing the
reliability of the compiler. 

Acovea is best for tiny programs but can also run whole makefiles.


After running (for a long time on a tiny program) it produces output such as
this (edited):


# runacovea -config gcc43_athlon_xp_nofm.acovea -input fftbench.c 2>&1 | tee
runacovea_1_log.txt

Acovea 5.1.1 (compiled Jun 14 2007 22:58:24) - Evolving Better Software
Invented by Scott Robert Ladd         (scott.ladd@coyotegulch.com)
            Coyote Gulch Productions  (http://www.coyotegulch.com)

   test application: fftbench.c
 config description: gcc 4.3.0 (20070609) Athlon-XP, no -ffast-math (version
1.0.0)
 test configuration: gcc43_athlon_xp_nofm.acovea
     acovea version: 5.1.1
    evocosm version: 3.1.0
application version: /usr/test/bin/gcc 4.3.0
   # of populations: 5
    population size: 40
      survival rate: 10% (4)
     migration rate: 5% (2)
      mutation rate: 1%
     crossover rate: 100%
    fitness scaling: sigma
 generations to run: 20
 random number seed: 3742623689
       testing mode: speed

    test start time: 2007 Jun 15 03:07:13

...(Lots of output)

generation 20 complete, average fitness: 3.65374

Acovea completed its analysis at 2007 Jun 15 07:51:19

Optimistic options:

               -fexpensive-optimizations  (1.599)
                       -fstrict-aliasing  (3.027)
                     -fgcse-after-reload  (1.678)

Pessimistic options:

                 -fno-tree-loop-optimize  (-1.733)
                               -fipa-pta  (-1.733)
                      -funroll-all-loops  (-2.844)
                           -ffloat-store  (-3.796)
           -fbranch-target-load-optimize  (-2.051)
                     -m96bit-long-double  (-2.527)
                            -mfpmath=387  (-1.813)
                            -mfpmath=sse  (-1.733)
                        -mfpmath=sse,387  (-3.082)

Acovea's Best-of-the-Best:
/usr/test/bin/gcc -lrt -lm -std=gnu99 -O1 -march=athlon-xp -fno-defer-pop
-fno-delayed-branch -fno-cprop-registers -fno-if-conversion2 -fno-tree-dce
-fno-tree-dse -fno-tree-sra -fno-tree-ch -fno-merge-constants
-fno-move-loop-invariants -fno-tree-loop-optimize -fno-tree-copy-prop
-fno-tree-salias -fno-tree-vect-loop-version -foptimize-sibling-calls
-fcse-follow-jumps -fgcse -fgcse-lm -fcrossjumping -fexpensive-optimizations
-foptimize-register-move -fschedule-insns2 -fsched-interblock
-fsched2-use-traces -fcaller-saves -ftree-pre -ftree-vrp -fpeephole2
-freorder-blocks -fstrict-aliasing -funit-at-a-time -falign-loops
-finline-functions -funswitch-loops -fpredictive-commoning -fgcse-after-reload
-fkeep-inline-functions -fgcse-sm -funsafe-loop-optimizations -fcheck-data-deps
-ftree-loop-im -fvect-cost-model -ftracer -fprefetch-loop-arrays
-freorder-blocks-and-partition -frtl-abstract-sequences -fpeel-loops
-fbranch-target-load-optimize -fno-function-cse -mieee-fp -mno-fp-ret-in-387
-mno-push-args -mno-align-stringops -mfpmath=sse -D__NO_MATH_INLINES -o
/tmp/ACOVEA92B15424 fftbench.c 

Acovea's Common Options:
/usr/test/bin/gcc -lrt -lm -std=gnu99 -O1 -march=athlon-xp -fno-tree-sra
-fno-tree-salias -foptimize-sibling-calls -fcrossjumping -finline-functions
-funswitch-loops -fgcse-after-reload -frtl-abstract-sequences
-mno-fp-ret-in-387 -D__NO_MATH_INLINES -o /tmp/ACOVEA33D4CB8D fftbench.c 

-O1:
/usr/test/bin/gcc -lrt -lm -std=gnu99 -O1 -march=athlon-xp -o
/tmp/ACOVEA63EB983B fftbench.c 

-O2:
/usr/test/bin/gcc -lrt -lm -std=gnu99 -O2 -march=athlon-xp -o
/tmp/ACOVEA34683D10 fftbench.c 

-O3:
/usr/test/bin/gcc -lrt -lm -std=gnu99 -O3 -march=athlon-xp -o
/tmp/ACOVEAD10E9653 fftbench.c 

-O3 -ffast-math:
/usr/test/bin/gcc -lrt -lm -std=gnu99 -O3 -march=athlon-xp -ffast-math -o
/tmp/ACOVEA61BFDD78 fftbench.c 

-Os:
/usr/test/bin/gcc -lrt -lm -std=gnu99 -Os -march=athlon-xp -o
/tmp/ACOVEAC35D20E9 fftbench.c 


A relative graph of fitnesses:

     Acovea's Best-of-the-Best: *****************************                  
      (1.7221)
       Acovea's Common Options: ****************************************       
      (2.36385)
                           -O1: **************************************         
      (2.26057)
                           -O2: ********************************               
      (1.89104)
                           -O3: ********************************               
      (1.91373)
               -O3 -ffast-math: *********************************              
      (1.96535)
                           -Os:
**************************************************    (2.92533)



An "optimistic" option was used in all the "good" solutions.
A "pessimistic" option was absent from the "good" solutions.

The "Best-of-the-Best" solution may contain options that had no practical
effect on code generation; they didn't hurt, didn't help, and were simply
present. The fitness graph compares the baseline with various options. 

Note that Acovea's Best-of-the-Best is better than "-O2" or "-O3" (on _my_
hardware, with this _one_ test program only). This can be used to "tune" the
"-O" options for specific processors.

Please attach Acovea application configuration files that are missing from this
page: http://www.coyotegulch.com/products/acovea/acovea-config.html


Please ONLY post GCC 4.3.0 bugs that the Acovea application finds in this
thread
and use a different thread for other versions of GCC, you can refer to here.

If the Acovea output does not show that the default "-O" options are out of
line or that there is a BUG in GCC 4.3.0 then please do not add frivolous
posts.


-- 
           Summary: Acovea finds bugs in GCC 4.3.0 and problems with default
                    optimizations levels
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rob1weld at aol dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32358


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug other/32358] Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels
  2007-06-15 16:49 [Bug other/32358] New: Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels rob1weld at aol dot com
  2007-06-15 16:53 ` [Bug other/32358] " rob1weld at aol dot com
@ 2007-06-15 16:53 ` rob1weld at aol dot com
  2007-06-15 17:06 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rob1weld at aol dot com @ 2007-06-15 16:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rob1weld at aol dot com  2007-06-15 16:52 -------
Created an attachment (id=13708)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13708&action=view)
Config - GCC 4.3.0 - Athlon-XP

Here is an Acovea configuration file for GCC 4.3.0 for an Athlon-XP.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32358


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug other/32358] Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels
  2007-06-15 16:49 [Bug other/32358] New: Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels rob1weld at aol dot com
@ 2007-06-15 16:53 ` rob1weld at aol dot com
  2007-06-15 16:53 ` rob1weld at aol dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rob1weld at aol dot com @ 2007-06-15 16:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rob1weld at aol dot com  2007-06-15 16:53 -------
When I used Acovea-5.1.1 it found that "-fipa-pta" always causes an ICE with
"-O" > zero.


Here is the complete documentation for the feature:

# grep -B1 -A2 ipa-pta /usr/test/info/gcc.info
`-fipa-pta'
     Perform interprocedural pointer analysis.



Here is an example that also fails (not what I was testing):

# cat test_1.c 
main() {
  printf("Hello\n");
}



# /usr/test/bin/gcc -O0 -fipa-pta -o delete_this test_1.c
test_1.c: In function 'main':
test_1.c:2: warning: incompatible implicit declaration of built-in function
'printf'
#

# /usr/test/bin/gcc -O1 -fipa-pta -o delete_this test_1.c
test_1.c: In function 'main':
test_1.c:2: warning: incompatible implicit declaration of built-in function
'printf'
test_1.c:3: error: stmt (0xb7cd0084) marked modified after optimization pass: 
__builtin_puts (&"Hello"[0]);
test_1.c:3: internal compiler error: verify_ssa failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
#

# /usr/test/bin/gcc -O2 -fipa-pta -o delete_this test_1.c
test_1.c: In function 'main':
test_1.c:2: warning: incompatible implicit declaration of built-in function
'printf'
test_1.c:3: error: stmt (0xb7ca6084) marked modified after optimization pass: 
__builtin_puts (&"Hello"[0]);
test_1.c:3: internal compiler error: verify_ssa failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
#

etc.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32358


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug other/32358] Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels
  2007-06-15 16:49 [Bug other/32358] New: Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels rob1weld at aol dot com
  2007-06-15 16:53 ` [Bug other/32358] " rob1weld at aol dot com
  2007-06-15 16:53 ` rob1weld at aol dot com
@ 2007-06-15 17:06 ` pinskia at gcc dot gnu dot org
  2007-06-15 21:32 ` rob1weld at aol dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-15 17:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2007-06-15 17:06 -------
>  When I used Acovea-5.1.1 it found that "-fipa-pta" always causes an ICE with "-O" > zero.

Known issue, see PR 32305.  -fipa-pta does nothing for code generation anyways.
 It just analysis the program and nothing more.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32358


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug other/32358] Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels
  2007-06-15 16:49 [Bug other/32358] New: Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels rob1weld at aol dot com
                   ` (2 preceding siblings ...)
  2007-06-15 17:06 ` pinskia at gcc dot gnu dot org
@ 2007-06-15 21:32 ` rob1weld at aol dot com
  2007-10-07 17:44 ` patrik dot hagglund at bredband dot net
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rob1weld at aol dot com @ 2007-06-15 21:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rob1weld at aol dot com  2007-06-15 21:32 -------
Thanks.

With Acovea I was able to discover the bug in a few hours with little effort
and provide a more trivial testcase with a better analysis.

Would someone run Acovea once a month on a few files to test gcc ?


I thought of another wonderful use for it. Alter Acovea or write a small
program so it can generate the .md's (and other such files) to produce
super-optimal code that runs as fast as possible and takes the least space for
each supported processor.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32358


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug other/32358] Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels
  2007-06-15 16:49 [Bug other/32358] New: Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels rob1weld at aol dot com
                   ` (3 preceding siblings ...)
  2007-06-15 21:32 ` rob1weld at aol dot com
@ 2007-10-07 17:44 ` patrik dot hagglund at bredband dot net
  2007-10-07 17:56 ` patrik dot hagglund at bredband dot net
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: patrik dot hagglund at bredband dot net @ 2007-10-07 17:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from patrik dot hagglund at bredband dot net  2007-10-07 17:44 -------
I have found two bugs using my own (unfinished/unreleased) Acovea
replacement (available upon request). Both are for -fsee.

gcc (GCC) 4.3.0 20071005 (experimental)

--

gcc -std=gnu99 -O3 -fsee fftbench.c
fftbench.c: In function 'main':
fftbench.c:214: error: invalid rtl sharing found in the insn
(insn 682 681 261 27 fftbench.c:78 (set (reg/v:SI 126 [ k2.337 ])
        (subreg:SI (reg:DI 313 [ k2.337 ]) 0)) -1 (nil))
fftbench.c:214: error: shared rtx
(subreg:SI (reg:DI 313 [ k2.337 ]) 0)
fftbench.c:214: internal compiler error: internal consistency failure

--

gcc -std=gnu99 -O3 -fsee -fno-regmove distbench.c
distbench.c: In function 'main':
distbench.c:140: internal compiler error: Segmentation fault


-- 

patrik dot hagglund at bredband dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |patrik dot hagglund at
                   |                            |bredband dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32358


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug other/32358] Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels
  2007-06-15 16:49 [Bug other/32358] New: Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels rob1weld at aol dot com
                   ` (5 preceding siblings ...)
  2007-10-07 17:56 ` patrik dot hagglund at bredband dot net
@ 2007-10-07 17:56 ` patrik dot hagglund at bredband dot net
  2007-12-03  4:10 ` pinskia at gcc dot gnu dot org
  2007-12-03  4:12 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: patrik dot hagglund at bredband dot net @ 2007-10-07 17:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from patrik dot hagglund at bredband dot net  2007-10-07 17:56 -------
Created an attachment (id=14314)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14314&action=view)
example benchmark in libacovea-5.1.1


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32358


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug other/32358] Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels
  2007-06-15 16:49 [Bug other/32358] New: Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels rob1weld at aol dot com
                   ` (4 preceding siblings ...)
  2007-10-07 17:44 ` patrik dot hagglund at bredband dot net
@ 2007-10-07 17:56 ` patrik dot hagglund at bredband dot net
  2007-10-07 17:56 ` patrik dot hagglund at bredband dot net
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: patrik dot hagglund at bredband dot net @ 2007-10-07 17:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from patrik dot hagglund at bredband dot net  2007-10-07 17:56 -------
Created an attachment (id=14315)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14315&action=view)
example benchmark in libacovea-5.1.1


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32358


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug other/32358] Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels
  2007-06-15 16:49 [Bug other/32358] New: Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels rob1weld at aol dot com
                   ` (6 preceding siblings ...)
  2007-10-07 17:56 ` patrik dot hagglund at bredband dot net
@ 2007-12-03  4:10 ` pinskia at gcc dot gnu dot org
  2007-12-03  4:12 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-12-03  4:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pinskia at gcc dot gnu dot org  2007-12-03 04:10 -------
(In reply to comment #5)
> gcc -std=gnu99 -O3 -fsee -fno-regmove distbench.c
> distbench.c: In function 'main':
> distbench.c:140: internal compiler error: Segmentation fault


I filed this as PR 34320.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32358


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug other/32358] Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels
  2007-06-15 16:49 [Bug other/32358] New: Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels rob1weld at aol dot com
                   ` (7 preceding siblings ...)
  2007-12-03  4:10 ` pinskia at gcc dot gnu dot org
@ 2007-12-03  4:12 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-12-03  4:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pinskia at gcc dot gnu dot org  2007-12-03 04:11 -------
(In reply to comment #5)
> gcc -std=gnu99 -O3 -fsee fftbench.c
> fftbench.c: In function 'main':
> fftbench.c:214: error: invalid rtl sharing found in the insn
> (insn 682 681 261 27 fftbench.c:78 (set (reg/v:SI 126 [ k2.337 ])
>         (subreg:SI (reg:DI 313 [ k2.337 ]) 0)) -1 (nil))
> fftbench.c:214: error: shared rtx
> (subreg:SI (reg:DI 313 [ k2.337 ]) 0)
> fftbench.c:214: internal compiler error: internal consistency failure

And this one has since been fixed so closing as invalid here.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32358


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-12-03  4:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-15 16:49 [Bug other/32358] New: Acovea finds bugs in GCC 4.3.0 and problems with default optimizations levels rob1weld at aol dot com
2007-06-15 16:53 ` [Bug other/32358] " rob1weld at aol dot com
2007-06-15 16:53 ` rob1weld at aol dot com
2007-06-15 17:06 ` pinskia at gcc dot gnu dot org
2007-06-15 21:32 ` rob1weld at aol dot com
2007-10-07 17:44 ` patrik dot hagglund at bredband dot net
2007-10-07 17:56 ` patrik dot hagglund at bredband dot net
2007-10-07 17:56 ` patrik dot hagglund at bredband dot net
2007-12-03  4:10 ` pinskia at gcc dot gnu dot org
2007-12-03  4:12 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).