[Bug c/107127] [11/12/13 Regression] Long compile times on code with C complex since r11-3299-gcba079f354a55363
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107127 --- Comment #6 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:8a0fce6a51915c29584427fd376b40073c328090 commit r13-4268-g8a0fce6a51915c29584427fd376b40073c328090 Author: Jakub Jelinek Date: Wed Nov 23 19:09:31 2022 +0100 c: Fix compile time hog in c_genericize [PR107127] The complex multiplications result in deeply nested set of many SAVE_EXPRs, which takes even on fast machines over 5 minutes to walk. This patch fixes that by using walk_tree_without_duplicates where it is instant. 2022-11-23 Andrew Pinski Jakub Jelinek PR c/107127 * c-gimplify.cc (c_genericize): Use walk_tree_without_duplicates instead of walk_tree for c_genericize_control_r. * gcc.dg/pr107127.c: New test.
[Bug c/107127] [11/12/13 Regression] Long compile times on code with C complex since r11-3299-gcba079f354a55363
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107127 Jakub Jelinek changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org CC||jakub at gcc dot gnu.org --- Comment #5 from Jakub Jelinek --- Created attachment 53941 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53941=edit gcc13-pr107127.patch I'll do it. Testcase extended so that it takes ~ 5 minutes on a fast machine without the patch and so that it will often time out.
[Bug c/107127] [11/12/13 Regression] Long compile times on code with C complex since r11-3299-gcba079f354a55363
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107127 Richard Biener changed: What|Removed |Added Priority|P3 |P2 --- Comment #4 from Richard Biener --- Mind testing a patch then...?
[Bug c/107127] [11/12/13 Regression] Long compile times on code with C complex since r11-3299-gcba079f354a55363
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107127 --- Comment #3 from Andrew Pinski --- If anything it is the walk of the tree in c_genericize (c-gimplify.c) Which is causing the issue. + walk_tree (_SAVED_TREE (fndecl), c_genericize_control_r, +NULL, NULL); I suspect walk_tree_without_duplicates might fix this rather than using walk_tree here.
[Bug c/107127] [11/12/13 Regression] Long compile times on code with C complex since r11-3299-gcba079f354a55363
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107127 Andrew Pinski changed: What|Removed |Added Target Milestone|--- |11.4
[Bug c/107127] [11/12/13 Regression] Long compile times on code with C complex since r11-3299-gcba079f354a55363
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107127 --- Comment #2 from Martin Liška --- Reduced test-case: $ cat x.i int *loopy_kernel_expr9; void loopy_kernel() { _Complex var_e9_11; double var_e9_15; ; ; double var_e9_6; ; loopy_kernel_expr9[0] / var_e9_6 * (0 - 0 / var_e9_11 + 699.0 + 7.050460596289373 - 286.0 - +-4.659839407494593 + 1.5759632377305621 + 0) * 0 - 3.287790705257411 + 4.226175928534705 + 0)) * var_e9_15 + 5.065182909294865) * 1.2325048646197416 * 0 * 0 - 8.459732847790127 + 0 + 88.0 + 6.967677749063906 + 867.0 + 9.104465770830789 - 7.042039895022722 * -1.0); } $ time gcc-7 x.i -c real0m0.028s user0m0.007s sys 0m0.021s $ time gcc-12 x.i -c real0m1.675s user0m1.656s sys 0m0.018s
[Bug c/107127] [11/12/13 Regression] Long compile times on code with C complex since r11-3299-gcba079f354a55363
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107127 Martin Liška changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Summary|[Regression 11/12] Long |[11/12/13 Regression] Long |compile times on code with |compile times on code with |C complex |C complex since ||r11-3299-gcba079f354a55363 CC||marxin at gcc dot gnu.org, ||sandra at codesourcery dot com Last reconfirmed||2022-10-03 --- Comment #1 from Martin Liška --- Started with r11-3299-gcba079f354a55363. Thanks for the bug report.