The source file pymol-1.1/layer0/Matrix.c fails to compile under gcc trunk with either '-O2 -fgraphite-identity' or '-O1 -fgraphite-identity'. In the first case the failure is... gcc-4 -fgraphite-identity -O2 -D_HAVE_LIBPNG -D_PYMOL_MODULE -D_PYMOL_NUMPY -D_PYMOL_FINK -c -o Matrix.o Matrix.iMatrix.c: In function ‘pymol_rg_’:Matrix.c:3059: error: edge from 641 to 9 should be marked irreducible Matrix.c:3059: error: basic block 644 should be marked irreducible Matrix.c:3059: error: edge from 644 to 642 should be marked irreducible Matrix.c:3059: error: edge from 640 to 11 should be marked irreducible Matrix.c:3059: internal compiler error: in verify_loop_structure, at cfgloop.c:1569 In the second case, the failure is... gcc-4 -fgraphite-identity -O1 -D_HAVE_LIBPNG -D_PYMOL_MODULE -D_PYMOL_NUMPY -D_PYMOL_FINK -c -o Matrix.o Matrix.i Matrix.c: In function ‘MatrixFitRMSTTTf’: Matrix.c:963: internal compiler error: in canonicalize_loop_ivs, at tree-parloops.c:1385 Only '-O0 -fgraphite-identity' compiles this source file without compile time errors.
Created attachment 16899 [details] preprocessed source for pymol-1.1/layer0/Matrix.i Compile with either... gcc-4 -fgraphite-identity -O2 -D_HAVE_LIBPNG -D_PYMOL_MODULE -D_PYMOL_NUMPY -D_PYMOL_FINK -c -o Matrix.o Matrix.i or gcc-4 -fgraphite-identity -O1 -D_HAVE_LIBPNG -D_PYMOL_MODULE -D_PYMOL_NUMPY -D_PYMOL_FINK -c -o Matrix.o Matrix.i to reproduce the failures.
Using r142742, '-O1 -fgraphite-identity' now compiles Matrix.c, however '-O2 -fgraphite-identity' still has the compile time errors... Matrix.c: In function ‘pymol_rg_’: Matrix.c:3059: error: edge from 509 to 9 should be marked irreducible Matrix.c:3059: error: basic block 512 should be marked irreducible Matrix.c:3059: error: edge from 512 to 510 should be marked irreducible Matrix.c:3059: error: edge from 508 to 11 should be marked irreducible Matrix.c:3059: internal compiler error: in verify_loop_structure, at cfgloop.c:1569
Created attachment 16942 [details] Proposed patch 2008-12-18 Harsha Jagasia <harsha.jagasia@amd.com> PR tree-optimization/38510 * gcc.dg/graphite/pr38510.c: New. * graphite.c (translate_clast): Call mark_irreducible_loops before graphite_verify. (gloog): Call mark_irreducible_loops before graphite_verify.
Created attachment 16946 [details] Fixed changes suggested by Sebastian Pop. 2008-12-19 Harsha Jagasia <harsha.jagasia@amd.com> PR tree-optimization/38510 * gcc.dg/graphite/pr38510.c: New. * graphite.c (recompute_all_dominators): Call mark_irreducible_loops. (translate_clast): Call recompute_all_dominators before graphite_verify. (gloog): Call recompute_all_dominators before graphite_verify.
I can confirm that current (r142846) gcc trunk, with the changes from r142728, r142722 and proposed patch in Comment 4 applied, builds pymol 1.1r2 completely under either -O3 or -O2 and -fgraphite-identity -funroll-loops -fomit-frame-pointer -ffast-math. The resulting pymol runs fine.
Subject: Re: Matrix.c from pymol 1.1r2 fails to compile with -O2 -fgraphite > ------- Comment #4 from hjagasia at gcc dot gnu dot org 2008-12-19 18:20 ------- > Created an attachment (id=16946) > --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16946&action=view) > Fixed changes suggested by Sebastian Pop. > Why did you introduced all these calls of recompute_all_dominators before the graphite_verify functions? Are all these calls needed? I don't think so. For instance, here: + recompute_all_dominators (); graphite_verify (); cleanup_tree_cfg (); recompute_all_dominators (); recompute_all_dominators is called twice with just cleanup_tree_cfg in between. I do not like the recompute_all_dominators calls: in the long run we should have all this information correctly updated during code generation, and not rely at all on recompute_all_dominators. If you can minimize the number of calls to recompute_all_dominators it would be nice, otherwise the patch is ok. Thanks, Sebastian
Subject: Bug 38510 Author: hjagasia Date: Mon Dec 22 19:24:59 2008 New Revision: 142888 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142888 Log: 2008-12-22 Harsha Jagasia <harsha.jagasia@amd.com> PR tree-optimization/38510 * gcc.dg/graphite/pr38510.c: New. * graphite.c (recompute_all_dominators): Call mark_irreducible_loops. (translate_clast): Call recompute_all_dominators before graphite_verify. (gloog): Call recompute_all_dominators before graphite_verify. Added: branches/graphite/gcc/testsuite/gcc.dg/graphite/pr38510.c Modified: branches/graphite/gcc/ChangeLog.graphite branches/graphite/gcc/graphite.c
Subject: Bug 38510 Author: spop Date: Mon Jan 5 21:03:45 2009 New Revision: 143094 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143094 Log: 2009-01-05 Harsha Jagasia <harsha.jagasia@amd.com> PR tree-optimization/38510 * graphite.c (recompute_all_dominators): Call mark_irreducible_loops. (translate_clast): Call recompute_all_dominators before graphite_verify. (gloog): Call recompute_all_dominators before graphite_verify. 2009-01-05 Harsha Jagasia <harsha.jagasia@amd.com> Jan Sjodin <jan.sjodin@amd.com> PR tree-optimization/38500 * graphite.c (create_sese_edges): Call fix_loop_structure after splitting blocks. 2009-01-05 Harsha Jagasia <harsha.jagasia@amd.com> PR tree-optimization/38510 * gcc.dg/graphite/pr38510.c: New. 2009-01-05 Harsha Jagasia <harsha.jagasia@amd.com> Jan Sjodin <jan.sjodin@amd.com> PR tree-optimization/38500 * gcc.dg/graphite/pr38500.c: New. Added: trunk/gcc/testsuite/gcc.dg/graphite/pr38500.c trunk/gcc/testsuite/gcc.dg/graphite/pr38510.c Modified: trunk/gcc/ChangeLog trunk/gcc/graphite.c trunk/gcc/testsuite/ChangeLog
Fixed.