From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76249 invoked by alias); 6 Jul 2015 16:07:27 -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 Received: (qmail 76191 invoked by uid 48); 6 Jul 2015 16:07:24 -0000 From: "dmalcolm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug jit/66779] jit segfault Date: Mon, 06 Jul 2015 16:07:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: jit X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dmalcolm at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed Message-ID: In-Reply-To: References: 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: 2015-07/txt/msg00472.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66779 David Malcolm changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2015-07-06 Ever confirmed|0 |1 --- Comment #1 from David Malcolm --- Root cause is here (in expr.c): 11035 tree type = lang_hooks.types.type_for_mode (mode, unsignedp); where the langhook returns NULL, leading to a segfault. 11034 enum tree_code tcode = code == NE ? NE_EXPR : EQ_EXPR; 11035 tree type = lang_hooks.types.type_for_mode (mode, unsignedp); 11036 tree temp = fold_build2_loc (loc, BIT_AND_EXPR, TREE_TYPE (arg1), 11037 gimple_assign_rhs1 (srcstmt), 11038 gimple_assign_rhs2 (srcstmt)); 11039 temp = fold_single_bit_test (loc, tcode, temp, arg1, type); (gdb) p mode $2 = QImode (gdb) p unsignedp $3 = 0 Guarded by: 11031 if (srcstmt 11032 && integer_pow2p (gimple_assign_rhs2 (srcstmt))) Fix is to handle the missing modes in jit_langhook_type_for_mode.