17724 – [4.0 Regression] wrong dominator (eh/fold all builtins) related (2024)

Description Andrew Pinski 2004-09-29 13:39:49 UTC

namespace ACE_OS {char *strcpy (char *s, const char *t);}extern "C" char *strcpy (char *__restrict __dest, __const char *__restrict __src) throw ();inline char *ACE_OS::strcpy (char *s, const char *t){return ::strcpy (s, t); }struct decon{~decon();};int fg();void f();int main (int, char *[]){ decon cmd_opts; int option; char config_file[4096]; ACE_OS::strcpy (config_file, "HAStatus.conf"); while ((option = fg()) != (-1)) if (option) return -1; return 0;}

Comment 1 Andrew Pinski 2004-09-29 13:41:55 UTC

This was the last preprocessed source in PR 17697, I jsut reduced it.: Search converges between 2004-07-21-trunk (#492) and 2004-07-23-trunk (#493).

Comment 2 Michael Cieslinski 2004-09-29 19:18:12 UTC

This ICE is caused by the patch to fix http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17697If you build a gcc without this patch you get:src.ii: In function `int main(int, char**)':scr.ii:7: error: Statement marked for throw, but doesn't.D.1829_4 = D.1844_32;src.ii:7: internal compiler error: verify_stmts failed.Please submit a full bug report, with preprocessed source if appropriate.With that patch you get:src.ii: In function `int main(int, char**)':src.ii:7: error: dominator of 4 should be 2, not 0src.ii:7: internal compiler error: in verify_dominators, at dominance.c:860Please submit a full bug report, with preprocessed source if appropriate.Michael Cieslinski

Comment 3 Andrew Pinski 2004-09-29 21:02:43 UTC

Actually the ICE is no caused by that patch, we just don't get passed verify_stmts before.

Comment 4 Andrew Pinski 2004-09-29 22:31:35 UTC

Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02990.html>.

Comment 5 Michael Cieslinski 2004-09-30 08:56:41 UTC

Many thanks to all gcc developers for your excellent work!I applied your patch, bootstraped gcc (on ppc-linux-gnu), run make check and found no new regressions.Also my application seems to compile (it takes a lot of time)Michael Cieslinski

Comment 6 Michael Cieslinski 2004-09-30 11:29:12 UTC

After compiling ~2500 files I found one where this error still occures.Below is a reduced testcase./usr/local/gcc40/bin/g++40 -O2 -c -o out.o src.ii -vReading specs from /usr/local/gcc40/lib/gcc/powerpc-unknown-linux-gnu/4.0.0/specsConfigured with: ../gcc40/configure --prefix=/usr/local/gcc40 --program-suffix=40 --with-cpu=G5 --enable-altivec --enable-languages=c,c++ --enable-checkingThread model: posixgcc version 4.0.0 20040926 (experimental) /usr/local/gcc40/libexec/gcc/powerpc-unknown-linux-gnu/4.0.0/cc1plus -fpreprocessed src.ii -quiet -dumpbase src.ii -mcpu=G5 -auxbase-strip out.o -O2 -version -o /tmp/ccRGaRii.sGNU C++ version 4.0.0 20040926 (experimental) (powerpc-unknown-linux-gnu) compiled by GNU C version 4.0.0 20040926 (experimental).GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096src.ii: In member function `int C::D()':src.ii:11: error: dominator of 3 should be 2, not 0src.ii:11: internal compiler error: in verify_dominators, at dominance.c:860Please submit a full bug report, with preprocessed source if appropriate.Michael Cieslinskiextern char *strcpy (char* d, const char* s) throw ();class A { public: A (); ~A (); };inline char * B (char *s, const char *t){ return ::strcpy (s, t); }class C { int D (void); int E; };int C::D (void){ A aa; try { char z [22]; if (this->E) B (z, ""); return 0; } catch (int &f) { return -1; } }

Comment 7 Giovanni Bajo 2004-09-30 11:57:09 UTC

Jakub, I'm assigning this bug to you since you posted a patch for it.Can you check if the new testcase is the same bug which still surfaces, or a new one (for which a new PR should be opened)? Thanks.

Comment 8 Jakub Jelinek 2004-10-01 12:41:01 UTC

Well, the testcase as is certainly doesn't fail with current CVS plushttp://gcc.gnu.org/ml/gcc-patches/2004-09/msg02990.html.When the first line is one of:extern char *strcpy (char* d, const char* s) throw ();extern "C" char *strcpy (char* d, const char* s) throw ();extern "C" char *strcpy (char* d, const char* s);it works just fine (though probably all 4 variants should be added to thetestsuite).But when the testcase starts with:extern char *strcpy (char* d, const char* s);it ICEs. The problem is different though, particularly thatdelete_unreachable_blocks nor delete_basic_block called from it updatesdominators info.IMHO either tree-cfg.c's remove_bb needs torecount_dominator/set_immediate_dominator if changed for all preds and succs bb'sor cleanup_tree_cfg needs to set some flag when delete_unreachable_blocks returnstrue and after the loop call free_dominance_info if that flag is set.

Comment 9 Andrew Pinski 2004-10-07 21:26:09 UTC

Newest patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-10/msg00658.html>.

Comment 10 Andrew Pinski 2004-10-10 18:15:37 UTC

Newest patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-10/msg00853.html>.

Comment 11 Michael Cieslinski 2004-10-12 07:25:07 UTC

Whith the patch http://gcc.gnu.org/ml/gcc-patches/2004-10/msg00853.htmlapplied I get a new ICE when I compile ACE542:/usr/local/gcc40/bin/g++40 -W -Wall -Wpointer-arith -fpermissive -O2 -D_REENTRANT -DACE_HAS_AIO_CALLS -D_GNU_SOURCE -I/home/cie019/ace542-gcc40 /ACE_wrappers -DACE_HAS_EXCEPTIONS -D__ACE_INLINE__ -I.. -c -o .obj/Map_Test.o Map_Test.cpp -gMap_Test.cpp: In function `void functionality_test(MAP&, size_t)':Map_Test.cpp:44: internal compiler error: in cp_tree_equal, at /cp/tree.c:1586Please submit a full bug report, with preprocessed source if appropriate.But when I specify -save-temps, this ICE does not occur.Also it does not occur if I omit "-g".How should I proceed?Michael Cieslinski

Comment 12 Giovanni Bajo 2004-10-12 08:45:02 UTC

If it cannot be reproduced with --save-temps, it is probably a memory corruption or something. I think we should do one thing at a time: once Jakub's patch is in, we will look into the following problem. Be patient, we will get to it :)

Comment 13 Michael Cieslinski 2004-10-12 08:48:14 UTC

I tried to copy all needed files in a directory and while this file set was still not complete I got a segmentation fault when I tried to compile.I filed a bug report bug17944Michael Cieslinski

Comment 14 Michael Cieslinski 2004-10-13 07:22:49 UTC

The ICE is not related to this patch.Michael Cieslinski

Comment 15 GCC Commits 2004-10-13 11:27:12 UTC

Subject: Bug 17724CVSROOT:/cvs/gccModule name:gccChanges by:jakub@gcc.gnu.org2004-10-13 11:27:02Modified files:gcc : ChangeLog tree-cfg.c gcc/testsuite : ChangeLog Added files:gcc/testsuite/g++.dg/opt: pr17724-1.C pr17724-2.C pr17724-3.C pr17724-4.C pr17724-5.C pr17724-6.C Log message:PR tree-optimization/17724* tree-cfg.c (tree_purge_dead_eh_edges): Free dominance info.* g++.dg/opt/pr17724-1.C: New test.* g++.dg/opt/pr17724-2.C: New test.* g++.dg/opt/pr17724-3.C: New test.* g++.dg/opt/pr17724-4.C: New test.* g++.dg/opt/pr17724-5.C: New test.* g++.dg/opt/pr17724-6.C: New test.Patches:

Comment 16 Andrew Pinski 2004-10-13 12:22:17 UTC

Fixed.
17724 – [4.0 Regression] wrong dominator (eh/fold all builtins) related (2024)
Top Articles
Latest Posts
Article information

Author: Edmund Hettinger DC

Last Updated:

Views: 6141

Rating: 4.8 / 5 (58 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Edmund Hettinger DC

Birthday: 1994-08-17

Address: 2033 Gerhold Pine, Port Jocelyn, VA 12101-5654

Phone: +8524399971620

Job: Central Manufacturing Supervisor

Hobby: Jogging, Metalworking, Tai chi, Shopping, Puzzles, Rock climbing, Crocheting

Introduction: My name is Edmund Hettinger DC, I am a adventurous, colorful, gifted, determined, precious, open, colorful person who loves writing and wants to share my knowledge and understanding with you.