public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "thibaut.lutz at googlemail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/63241] New: Internal error in gimplify_init_constructor when using constexr and multidimensional arrays Date: Fri, 12 Sep 2014 12:36:00 -0000 [thread overview] Message-ID: <bug-63241-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63241 Bug ID: 63241 Summary: Internal error in gimplify_init_constructor when using constexr and multidimensional arrays Product: gcc Version: 4.9.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: thibaut.lutz at googlemail dot com I stumbled upon a weird regression bug. The test case below is working fine with GCC 4.8 and 4.9.0 but triggers an internal error on 4.9.1. I haven't tested 4.9.2. Any of these modifications would remove the error: - removing `constexpr` from the constructor at line 2 - using `0` instead of `i` in the second array element constructor at line 8 - using `const int i` instead of `int i` at line 6 - using a 1D array instead of a 2D array at line 7 So I believe the example below cannot be reduced further. However somehow the combination of `constexpr` constructor and multidimensional array is causing the compiler to crash. Details: * GCC version: 4.9.1 built with default config * System: x86_64 GNU/Linux * Command line: c++ -std=c++11 bug.cpp * Minimal example: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> struct A { constexpr A(int){} }; int main() { int i = 1; A array[2][2] = {{{0}, {i}}, {{0}, {0}}}; } <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< * Output: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> bug.cpp: In function ‘int main()’: bug.cpp:9:16: internal compiler error: in gimplify_init_constructor, at gimplify.c:4007 {{0}, {0}}}; ^ 0x7f6213 gimplify_init_constructor ../.././gcc/gimplify.c:4007 0x7f6dee gimplify_modify_expr_rhs ../.././gcc/gimplify.c:4167 0x7f6ec4 gimplify_modify_expr ../.././gcc/gimplify.c:4486 0x7f7dda gimplify_expr(tree_node**, gimple_statement_base**, gimple_statement_base**, bool (*)(tree_node*), int) ../.././gcc/gimplify.c:7627 0x7facd6 gimplify_stmt(tree_node**, gimple_statement_base**) ../.././gcc/gimplify.c:5373 0x7f806a gimplify_cleanup_point_expr ../.././gcc/gimplify.c:5149 0x7f806a gimplify_expr(tree_node**, gimple_statement_base**, gimple_statement_base**, bool (*)(tree_node*), int) ../.././gcc/gimplify.c:7990 0x7facd6 gimplify_stmt(tree_node**, gimple_statement_base**) ../.././gcc/gimplify.c:5373 0x7f8d3b gimplify_statement_list ../.././gcc/gimplify.c:1432 0x7f8d3b gimplify_expr(tree_node**, gimple_statement_base**, gimple_statement_base**, bool (*)(tree_node*), int) ../.././gcc/gimplify.c:8042 0x7facd6 gimplify_stmt(tree_node**, gimple_statement_base**) ../.././gcc/gimplify.c:5373 0x7f806a gimplify_cleanup_point_expr ../.././gcc/gimplify.c:5149 0x7f806a gimplify_expr(tree_node**, gimple_statement_base**, gimple_statement_base**, bool (*)(tree_node*), int) ../.././gcc/gimplify.c:7990 0x7facd6 gimplify_stmt(tree_node**, gimple_statement_base**) ../.././gcc/gimplify.c:5373 0x7f8d3b gimplify_statement_list ../.././gcc/gimplify.c:1432 0x7f8d3b gimplify_expr(tree_node**, gimple_statement_base**, gimple_statement_base**, bool (*)(tree_node*), int) ../.././gcc/gimplify.c:8042 0x7facd6 gimplify_stmt(tree_node**, gimple_statement_base**) ../.././gcc/gimplify.c:5373 0x7fb56b gimplify_bind_expr ../.././gcc/gimplify.c:1099 0x7f7fc0 gimplify_expr(tree_node**, gimple_statement_base**, gimple_statement_base**, bool (*)(tree_node*), int) ../.././gcc/gimplify.c:7824 0x7facd6 gimplify_stmt(tree_node**, gimple_statement_base**) ../.././gcc/gimplify.c:5373 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >From gcc-bugs-return-461669-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 12 12:45:26 2014 Return-Path: <gcc-bugs-return-461669-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org> Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 13719 invoked by alias); 12 Sep 2014 12:45:25 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: <gcc-bugs.gcc.gnu.org> List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/> List-Post: <mailto:gcc-bugs@gcc.gnu.org> List-Help: <mailto:gcc-bugs-help@gcc.gnu.org> Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 13646 invoked by uid 48); 12 Sep 2014 12:45:21 -0000 From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/62631] gcc.dg/tree-ssa/ivopts-lt-2.c FAILs Date: Fri, 12 Sep 2014 12:45:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ebotcazou at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ebotcazou at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status component assigned_to Message-ID: <bug-62631-4-6Oz3ZxQ7lh@http.gcc.gnu.org/bugzilla/> In-Reply-To: <bug-62631-4@http.gcc.gnu.org/bugzilla/> References: <bug-62631-4@http.gcc.gnu.org/bugzilla/> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-09/txt/msg01503.txt.bz2 Content-length: 955 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62631 Eric Botcazou <ebotcazou at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Component|tree-optimization |target Assignee|unassigned at gcc dot gnu.org |ebotcazou at gcc dot gnu.org --- Comment #10 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- > * For the mult part, rtx_code calls sparc_rtx_cost, which has > > case MULT: > if (float_mode_p) > *total = sparc_costs->float_mul; > else if (! TARGET_HARD_MUL) > *total = COSTS_N_INSNS (25); > > On SPARCv9/-m64, TARGET_HARD_MUL is false, so we get the 25*4 = 100 part, > unlike v8, which explains why the test only fails for 64-bit. Ugh, thanks for spotting it, this looks like an annoying oversight. >From gcc-bugs-return-461670-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 12 12:56:44 2014 Return-Path: <gcc-bugs-return-461670-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org> Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 18696 invoked by alias); 12 Sep 2014 12:56:44 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: <gcc-bugs.gcc.gnu.org> List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/> List-Post: <mailto:gcc-bugs@gcc.gnu.org> List-Help: <mailto:gcc-bugs-help@gcc.gnu.org> Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 18653 invoked by uid 48); 12 Sep 2014 12:56:39 -0000 From: "wbrana at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/63242] New: memory starvation caused by flatten attribute Date: Fri, 12 Sep 2014 12:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: wbrana at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: <bug-63242-4@http.gcc.gnu.org/bugzilla/> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-09/txt/msg01504.txt.bz2 Content-length: 977 https://gcc.gnu.org/bugzilla/show_bug.cgi?idc242 Bug ID: 63242 Summary: memory starvation caused by flatten attribute Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: wbrana at gmail dot com forwarded from https://bugs.freedesktop.org/show_bug.cgi?idw580 Hello, I've been testing GCC 4.9 for a virtual gentoo machine and I noticed that you us flatten attribute in source code. In case of src/sna/sna_glyphs.c flatten functions, inliner inlines about 3.3M functions and crashes because of no free memory (I have 8GB memory). Please notice that LTO has ability to optimize whole program. As a result, it sees almost all function bodies and that leads to enormous inlining. Suggested patch removes these flatten attributes for selected functions. Thank you, MArtin
next reply other threads:[~2014-09-12 12:36 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-09-12 12:36 thibaut.lutz at googlemail dot com [this message] 2014-09-17 14:12 ` [Bug c++/63241] " paolo.carlini at oracle dot com 2014-09-17 14:30 ` paolo at gcc dot gnu.org 2014-09-17 14:31 ` paolo at gcc dot gnu.org 2014-09-17 14:31 ` paolo.carlini at oracle dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-63241-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).