From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112672 invoked by alias); 10 Apr 2015 09:04:53 -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 112485 invoked by uid 48); 10 Apr 2015 09:04:50 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/65729] [5 Regression] ICE (in prohibited_class_reg_set_mode_p, at lra-constraints.c) on arm-linux-gnueabihf Date: Fri, 10 Apr 2015 09:04: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: ice-on-valid-code, ra X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: 2015-04/txt/msg00813.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D65729 --- Comment #2 from Jakub Jelinek --- Seems the ICE or successful compilation aren't the only thing gcc used to produce here: old - r218687 ok=20=20=20=20=20 r218688 - r218759 error: inconsistent operand constraints in an =E2=80=98as= m=E2=80=99=20=20=20 r218760 - r220293 ok=20 r220294 - latest internal compiler error: in prohibited_class_reg_set_mode_= p, at lra-constraints.c >>From gcc-bugs-return-483260-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Apr 10 09:04:20 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 110008 invoked by alias); 10 Apr 2015 09:04:19 -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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 107718 invoked by uid 48); 10 Apr 2015 09:04:15 -0000 From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/65727] [4.8/4.9/5 Regression] Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member Date: Fri, 10 Apr 2015 09:04:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: major X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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-04/txt/msg00812.txt.bz2 Content-length: 1435 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65727 --- Comment #2 from Marek Polacek --- Here, we're trying to build_x_indirect_ref for a NULL pointer, that is bad. The reason is that here 787 /* In a lambda, need to go through 'this' capture. */ 788 tree lam = CLASSTYPE_LAMBDA_EXPR (current_class_type); 789 tree cap = lambda_expr_this_capture (lam, add_capture_p); 790 if (cap != error_mark_node) 791 object = build_x_indirect_ref (EXPR_LOCATION (object), cap, 792 RO_NULL, tf_warning_or_error); lambda_expr_this_capture returns NULL: it's looking for 'this', but doesn't find it. The fix in r215478 [1] dealt with not finding 'this' by checking for error_mark, but perhaps we should also check whether the capture is non-NULL: --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -787,7 +787,7 @@ maybe_resolve_dummy (tree object, bool add_capture_p) /* In a lambda, need to go through 'this' capture. */ tree lam = CLASSTYPE_LAMBDA_EXPR (current_class_type); tree cap = lambda_expr_this_capture (lam, add_capture_p); - if (cap != error_mark_node) + if (cap && cap != error_mark_node) object = build_x_indirect_ref (EXPR_LOCATION (object), cap, RO_NULL, tf_warning_or_error); } [1] https://gcc.gnu.org/ml/gcc-patches/2014-09/msg01878.html