From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 41793 invoked by alias); 19 Jan 2018 13:17:04 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 41781 invoked by uid 89); 19 Jan 2018 13:17:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.1 required=5.0 tests=BAYES_00,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=MinGW-w64, MinGWw64, H*c:alternative, 4.4.7 X-HELO: mail-it0-f52.google.com Received: from mail-it0-f52.google.com (HELO mail-it0-f52.google.com) (209.85.214.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 19 Jan 2018 13:17:00 +0000 Received: by mail-it0-f52.google.com with SMTP id e1so2083942ita.0 for ; Fri, 19 Jan 2018 05:17:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ByiGYgC/U1TMyzsXBvC/fujmGZ1qqUSkzvxZC7etYDQ=; b=poWtzQP25bmebj11vGE1AGke49abqHPlrQGhxl+yXRVlFyxRNc45Ca5kOfOb7/0Naa uKxD3CXnsiLTke8A9SVjb5pSYTGNPO0nE/6Zjy2UMTwJwL81BKEc6wGTLffgGii877cH rEvS74ZOckXnyUVMtW5g2AeBc5egYMZ3ob7DuCumJpjur9uw3SBSCf03ZX0Pl2/wft1n 5/5YsPxCtzBSBfLCoFjQo2XGoicIj0YLfbCz5VN5ERmGILPN/v5bi7Of9fPPTsAAiIBF t+7fDIosXHkUvFI/XvN0sGxDnH9ie5UfAKFdFgbBMEf9oP3MdjgJTvNyov6i8ug2qrMI i/cQ== X-Gm-Message-State: AKwxyteBirmKzSV+cs7624WxSiyssLI5SSQ6b5NkOzNlbJ3RNginTJmx nLuCMPlio8iLm+3IEXFp4kg2EXBb1OysQ3tj4zorBpyYC50= X-Google-Smtp-Source: ACJfBosBN47Cfc1jjPOlTyKgc8wqGCR3TtDRm0e+ISIZsMGCJV40ZgMOn+QJrf1wJI0pEzfKJ907nXo2xdLXaQmU31U= X-Received: by 10.36.219.195 with SMTP id c186mr5218113itg.61.1516367818289; Fri, 19 Jan 2018 05:16:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.227.136 with HTTP; Fri, 19 Jan 2018 05:16:57 -0800 (PST) From: "Matt Sexton via gcc-help" Reply-To: Matt Sexton Date: Fri, 19 Jan 2018 13:17:00 -0000 Message-ID: Subject: internal compiler error To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-01/txt/msg00096.txt.bz2 Hello, I am encountering an internal compiler error when compiling with -O2 internal compiler error: in get_constraint_for_ptr_offset, at tree-ssa-structalias.c:3155 I see this error when using the MinGW-w64 version of gcc, both version 7.2.0 on Fedora 27 and version 6.4.0 on Fedora 25. I do not see the error with MinGW version 4.9.2 on Fedora 21. I do not see this error when compiling natively for Linux on Centos 6 (4.4.7), Centos 7 (4.8.5), Fedora 21 (4.9.2), Fedora 25 (6.4.1), or Fedora 27 (7.2.1). A backtrace: #0 0x00007ffff649db90 in exit () from /lib64/libc.so.6 #1 0x0000000000f615a7 in diagnostic_action_after_output(diagnostic_context*, diagnostic_t) () #2 0x0000000000f61cdd in diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*) () #3 0x0000000000f6219f in diagnostic_impl(rich_location*, int, char const*, __va_list_tag (*) [1], diagnostic_t) () #4 0x0000000000f62dc5 in internal_error(char const*, ...) () #5 0x0000000000f614f4 in fancy_abort(char const*, int, char const*) () #6 0x00000000009f0703 in get_constraint_for_ptr_offset(tree_node*, tree_node*, vec*) () #7 0x00000000009f2162 in find_func_aliases(function*, gimple*) () #8 0x00000000009f79ef in compute_may_aliases() () #9 0x00000000007c6782 in execute_function_todo(function*, void*) () #10 0x00000000007c7853 in execute_todo(unsigned int) () #11 0x00000000007c95ee in execute_one_pass(opt_pass*) () #12 0x00000000007c9c71 in execute_pass_list_1(opt_pass*) () #13 0x00000000007c9c83 in execute_pass_list_1(opt_pass*) () #14 0x00000000007c9cc5 in execute_pass_list(function*, opt_pass*) () #15 0x000000000054f2c5 in cgraph_node::expand() () #16 0x00000000005505e1 in symbol_table::compile() [clone .part.51] () #17 0x0000000000552257 in symbol_table::finalize_compilation_unit() () #18 0x0000000000880d2a in compile_file() () #19 0x00000000004294d5 in toplev::main(int, char**) () #20 0x000000000042b83b in main () The problem does not occur with -O. I attempted to narrow down the error to a particular optimization flag by adding the additional optimization flags enabled by -O2, as documented in the man page. However, this approach produced slightly different behavior: internal compiler error: Segmentation fault I found two flags, either of which added to -O triggers a segfault: -ftree-pre and -fcode-hoisting. A backtrace from running with "-O -ftree-pre" #0 0x00000000009b2c1f in find_or_generate_expression(basic_block_def*, tree_node*, gimple**) () #1 0x00000000009b234e in create_expression_by_pieces(basic_block_def*, pre_expr_d*, gimple**, tree_node*) () #2 0x00000000009b43d2 in insert_into_preds_of_block(basic_block_def*, unsigned int, vec) () #3 0x00000000009b666b in insert_aux(basic_block_def*, bool, bool) () #4 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #5 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #6 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #7 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #8 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #9 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #10 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #11 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #12 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #13 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #14 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #15 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #16 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #17 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #18 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #19 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #20 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #21 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #22 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #23 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #24 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #25 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #26 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #27 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #28 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #29 0x00000000009b7c19 in (anonymous namespace)::pass_pre::execute(function*) () #30 0x00000000007c94a9 in execute_one_pass(opt_pass*) () #31 0x00000000007c9c71 in execute_pass_list_1(opt_pass*) () #32 0x00000000007c9c83 in execute_pass_list_1(opt_pass*) () #33 0x00000000007c9cc5 in execute_pass_list(function*, opt_pass*) () #34 0x000000000054f2c5 in cgraph_node::expand() () #35 0x00000000005505e1 in symbol_table::compile() [clone .part.51] () #36 0x0000000000552257 in symbol_table::finalize_compilation_unit() () #37 0x0000000000880d2a in compile_file() () #38 0x00000000004294d5 in toplev::main(int, char**) () #39 0x000000000042b83b in main () And a backtrace with "-O -fcode-hoisting" #0 0x00000000009b2c1f in find_or_generate_expression(basic_block_def*, tree_node*, gimple**) () #1 0x00000000009b234e in create_expression_by_pieces(basic_block_def*, pre_expr_d*, gimple**, tree_node*) () #2 0x00000000009b64f8 in insert_aux(basic_block_def*, bool, bool) () #3 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #4 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #5 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #6 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #7 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #8 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #9 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #10 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #11 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #12 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #13 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #14 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #15 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #16 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #17 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #18 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #19 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #20 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #21 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #22 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #23 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #24 0x00000000009b59a8 in insert_aux(basic_block_def*, bool, bool) () #25 0x00000000009b7c19 in (anonymous namespace)::pass_pre::execute(function*) () #26 0x00000000007c94a9 in execute_one_pass(opt_pass*) () #27 0x00000000007c9c71 in execute_pass_list_1(opt_pass*) () #28 0x00000000007c9c83 in execute_pass_list_1(opt_pass*) () #29 0x00000000007c9cc5 in execute_pass_list(function*, opt_pass*) () #30 0x000000000054f2c5 in cgraph_node::expand() () #31 0x00000000005505e1 in symbol_table::compile() [clone .part.51] () #32 0x0000000000552257 in symbol_table::finalize_compilation_unit() () #33 0x0000000000880d2a in compile_file() () #34 0x00000000004294d5 in toplev::main(int, char**) () #35 0x000000000042b83b in main () Passing "-O2 -fno-tree-pre -fno-code-hoisting" to gcc still triggers the segfault. At this point, I do not have a small piece of code that I can share that triggers the problem, though I will try to do so. Can someone offer some suggestions on how to avoid the problem without turning off all of -O2? Or how I can provide more information to track down the underlying problem? Thank you, Matt