From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 062D6383B426 for ; Wed, 23 Jun 2021 19:25:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 062D6383B426 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-599-kN4Ii4V1Mauf_VlTdDfl9Q-1; Wed, 23 Jun 2021 15:25:04 -0400 X-MC-Unique: kN4Ii4V1Mauf_VlTdDfl9Q-1 Received: by mail-qk1-f197.google.com with SMTP id e13-20020a37e50d0000b02903ad5730c883so3668161qkg.22 for ; Wed, 23 Jun 2021 12:25:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=5fQ6ghPHP7M2ywPr3Lyw1lb+PMnP80NkChUe/IvfSQA=; b=sb4OcRlumIrC2qtCRzoQVaJ5lJWllRHFXc/MirdigTNUvPsQGiyP56YzPa6TnioyoH 785LLJ57Ln21v0QaiBpmaJvnUDu85coJNKT3lJwTQtcdYXl+A4RrowBfIQFglmh1dCwj jfue3gSFuHyh59cK4Pg8Ltdp4rG7UNb1hp25TFbQk4FBhSf7qHddYrcQMhxXLX+ohBsk wm2KCEFX+L2ixShBUiX3v1aHQ9WJqvXnoNWtzdZvqtDb6faD0YfXmIkT3V9gOJun8v0o 6Y+k11XOeOGw7R3LKCTb8zbUrPna+grYRGHIRI2Ut3jQN8eehXQxqNXluMFi8dfglXDe URzg== X-Gm-Message-State: AOAM532yzd5ndG/+iF1Hx/BNcSebb7yIZVg0VWp0zA4ZUBRCwUu2bbUa 5v4dJifxPkAlaXmdDCrzTDTHpeXvmAzhgs9JI8BROIhwQPcsvtdm10LhEQjkAlXKUWCCyf/16rr DH4TjkmJo7zSzD5pTnd4rzys4724syUimMoN6kYvyrW+5Z92Ic5tdh/MTgn6FnK9oc88Itg== X-Received: by 2002:a37:d4d:: with SMTP id 74mr1645902qkn.354.1624476303578; Wed, 23 Jun 2021 12:25:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEM/kRdxr8hIPcUEhkPLmI4BTxVp5bpoqaWf7O3F9QBmwCloo+n04y2utfZSNkdeJ3aHBu6g== X-Received: by 2002:a37:d4d:: with SMTP id 74mr1645882qkn.354.1624476303332; Wed, 23 Jun 2021 12:25:03 -0700 (PDT) Received: from ?IPv6:2607:fea8:a241:4600::58f9? ([2607:fea8:a241:4600::58f9]) by smtp.gmail.com with ESMTPSA id 5sm603935qkj.99.2021.06.23.12.25.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Jun 2021 12:25:02 -0700 (PDT) Subject: Re: [RFC] Return NULL from gimple_call_return_type if no return available. To: Richard Biener , Aldy Hernandez , Aldy Hernandez via Gcc-patches References: <20210623150305.411460-1-aldyh@redhat.com> From: Andrew MacLeod Message-ID: <21075381-4311-3e94-f48b-015373880c7c@redhat.com> Date: Wed, 23 Jun 2021 15:25:01 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-CA X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2021 19:25:07 -0000 On 6/23/21 2:37 PM, Richard Biener via Gcc-patches wrote: > On June 23, 2021 5:03:05 PM GMT+02:00, Aldy Hernandez via Gcc-patches wrote: >> The call to gimple_call_fntype() in gimple_call_return_type() may >> return >> NULL, which causes the TREE_TYPE(lhs) to ICE. I think it would be best >> to >> return NULL (or void_type_node) rather than aborting. >> >> I'm running into this because fold_using_range::range_of_call, calls >> gimple_call_return_type which may ICE for builtins with no LHS. >> Instead >> of special casing things in range_of_call, perhaps it's best to plug >> the >> source. >> >> Does this sound reasonable? > No, you need to make sure to not call this on an internal function call instead. > Otherwise it is never NULL. > > Richard. Out of curiosity, why is it not OK to call this on an internal function call?   Shouldn't all calls return something at least? like VOIDmode if they don't return anything?  It just seems like it needs to be special cased either at any possible call site, or simply in the routine.   we stumbled across it and it wasn't obvious why. Andrew