From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110660 invoked by alias); 16 Feb 2018 13:52:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 110622 invoked by uid 89); 16 Feb 2018 13:52:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=Hx-languages-length:1071 X-HELO: mail-io0-f195.google.com Received: from mail-io0-f195.google.com (HELO mail-io0-f195.google.com) (209.85.223.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Feb 2018 13:52:32 +0000 Received: by mail-io0-f195.google.com with SMTP id e4so4157738iob.8 for ; Fri, 16 Feb 2018 05:52:32 -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:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ndVIhqEF50FSR1SUTa8xG2IZJ5dkmeqrtVRm9tBaN9k=; b=VXvuNmwfjpa+hg/F+e1B2ToJDUzaSlhI0buCbOKQKtvQ8j5epQ6eWB3CQ1Tj/FQ6fH S7B3Bn1UIxkBV3yjDt3E9HQSeRnTK/R/317ISVan+yYfebohL823l/QPVQ5kBMvZaZxF Tg3ry+/6HWQ6VCOeeP6xDkBOIh9k52WSuNpRpaUsnjWLUwtw5SxzpOQJyzOYswauVJ+Z lM34L+h6DqR4msFcr/CuYk+6uDYOqDHemj6+dyx+UzbBgdMvVqoCP7B7WlEOzaUKoLz4 054LmYcO8AJDIpgLQZYsTWq3x+sGtC/NkKCLu4i3+NkhkZ6klWulz2vnAQst50Iq7JeA xkkw== X-Gm-Message-State: APf1xPAxgdy07+/jDYNuhvBnzX/oej44qbUjSur9EwqkbRYO8n8mWXRM PzL1q0q1Xv/KHwvMKxDHai+JEJtQWGCf73LVvlIQbQ== X-Google-Smtp-Source: AH8x22547ITS52GQ9itbk5UUxiDQW8l4BohxNQlkaEGs6iGwSFKm06GODARxvx1RLh+4U0MdrKqVrsXBYeBjbmxRbaY= X-Received: by 10.107.183.76 with SMTP id h73mr8275188iof.201.1518789150857; Fri, 16 Feb 2018 05:52:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.17.200 with HTTP; Fri, 16 Feb 2018 05:52:10 -0800 (PST) In-Reply-To: <20180216082814.GM5867@tucnak> References: <20180216082814.GM5867@tucnak> From: Jason Merrill Date: Fri, 16 Feb 2018 13:52:00 -0000 Message-ID: Subject: Re: [C++ PATCH] Fix ICE with return in statement expression in constexpr.c (PR c++/84192) To: Jakub Jelinek Cc: gcc-patches List Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00978.txt.bz2 On Fri, Feb 16, 2018 at 3:28 AM, Jakub Jelinek wrote: > pop_stmt_list, if there is just a single stmt inside statement expression > moves the stmt out of the STATEMENT_LIST (and I think cp_fold does too). > We only initialize jump_target to non-NULL in cxx_eval_statement_list > or for calls, so before we have a chance to diagnose the error of using > an expression with void type, we ICE trying to dereference NULL jump_target. > > This can't happen with BREAK_STMT nor CONTINUE_STMT, because they are not > potential constant expressions, and I think can only happen when ctx->quiet > is true, otherwise it should have been diagnosed already before. > If a RETURN_EXPR (or in theory break/continue) appears in a (potential) constant > expression we want to evaluate, not doing anything with jump_target if we > aren't inside a statement list makes sense to me, there is no following > statement to bypass. I think we should also set *non_constant_p. Jason