From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12253 invoked by alias); 1 Feb 2011 15:36:29 -0000 Received: (qmail 12132 invoked by uid 22791); 1 Feb 2011 15:36:28 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 01 Feb 2011 15:36:24 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/47566] ICE in vn_reference_lookup X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status Last reconfirmed AssignedTo Ever Confirmed Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Tue, 01 Feb 2011 15:36:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-02/txt/msg00114.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47566 Richard Guenther changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2011.02.01 15:36:11 AssignedTo|unassigned at gcc dot |rguenth at gcc dot gnu.org |gnu.org | Ever Confirmed|0 |1 --- Comment #9 from Richard Guenther 2011-02-01 15:36:11 UTC --- I can reproduce it. I also run into In file included from :425:0: /tmp/cp2k/makefiles/../src/realspace_grid_types.F: In function 'rs_pw_transfer_replicated': /tmp/cp2k/makefiles/../src/realspace_grid_types.F:816:0: error: non-trivial conversion at assignment struct array3_real(kind=8) struct array3_real(kind=8) # .MEM_755 = VDEF <.MEM_649> grid = D.39399_277->r; and a couple of similar ICEs in other ltrans units. Probably the known restrict vs. non-restrict bug. The bug happens when optimizing fft3d_pb, it also happens with -fno-inline so indeed the bug might be triggered by the mix of -O0 and -O3 (thus, by not running early optimizations). Seems to be -ffast-math vs. non-fast-math. We fold calls during PRE insertion which turns cabs into components (complex lowering). That folding, folded = build_call_array (currop->type, (TREE_CODE (fn) == FUNCTION_DECL ? build_fold_addr_expr (fn) : fn), nargs, args); can create arbitrary number of expressions, including for some reason non-gimple reg vars. In particular fold_builtin_cabs returns __builtin_sqrt (__builtin_pow (SAVE_EXPR >>, 2.0e+0) + __builtin_pow (SAVE_EXPR >>, 2.0e+0)) and then save-expr gimplification introduces the non-register temporary as a result of SSA_NAME save-expr (which is unnecessary anyway). The following fixes the ICE for me: Index: builtins.c =================================================================== --- builtins.c (revision 169476) +++ builtins.c (working copy) @@ -652,9 +652,10 @@ target_char_cast (tree cst, char *p) static tree builtin_save_expr (tree exp) { - if (TREE_ADDRESSABLE (exp) == 0 - && (TREE_CODE (exp) == PARM_DECL - || (TREE_CODE (exp) == VAR_DECL && !TREE_STATIC (exp)))) + if (TREE_CODE (exp) == SSA_NAME + || (TREE_ADDRESSABLE (exp) == 0 + && (TREE_CODE (exp) == PARM_DECL + || (TREE_CODE (exp) == VAR_DECL && !TREE_STATIC (exp))))) return exp; return save_expr (exp);