From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14605 invoked by alias); 14 Nov 2008 09:01:52 -0000 Received: (qmail 8161 invoked by uid 48); 14 Nov 2008 09:00:26 -0000 Date: Fri, 14 Nov 2008 09:01:00 -0000 Message-ID: <20081114090026.8160.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/38104] [4.4 Regression] ICE segmentation fault (with -O3 when deref a NULL pointer in the code??) In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jakub at gcc dot gnu dot org" 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: 2008-11/txt/msg01060.txt.bz2 ------- Comment #2 from jakub at gcc dot gnu dot org 2008-11-14 09:00 ------- 3 possible ways to fix this: 1) in get_addr_dereference_operands use if (v_ann && v_ann->symbol_mem_tag) 2) in get_addr_dereference_operands use get_var_ann (ptr) instead of var_ann (ptr). 3) --- gimplify.c.jj 2008-11-13 15:02:56.000000000 +0100 +++ gimplify.c 2008-11-14 09:50:53.000000000 +0100 @@ -7566,6 +7566,10 @@ gimple_regimplify_operands (gimple stmt, break; } + if (gimple_referenced_vars (cfun)) + for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t)) + add_referenced_var (t); + if (!gimple_seq_empty_p (pre)) { if (gimple_in_ssa_p (cfun)) @@ -7580,10 +7584,6 @@ gimple_regimplify_operands (gimple stmt, if (post_stmt) gsi_insert_after (gsi_p, post_stmt, GSI_NEW_STMT); - if (gimple_referenced_vars (cfun)) - for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t)) - add_referenced_var (t); - pop_gimplify_context (NULL); } By marking all new vars as referenced in gimplify_regimplify_operands before mark_symbols_for_renaming get_var_ann is called before update_stmt and var_ann in it. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38104