From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 634A63AA943D; Mon, 12 Dec 2022 11:21:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 634A63AA943D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670844068; bh=bIsoJIwx5PL8S+YJy0q4ttAKBjFrd1S+rD1EsAQttgE=; h=From:To:Subject:Date:From; b=RnpEXwWyyvnhlsByP5cSsOXfl+At5XQTlLbQh+7U474T3SthML4FCWBEyDxRzAUzi x2DSE6jo6USQVw6hK0TwIyPN1bQc6Xw9sy5A5mRKZ+at9wX2f9jSDoRi27E8qzRIbF XOUPr7Fc1HGLIkwJ+Ybq7HCaG+Ts6nH96AIWqFrU= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-8979] tree-optimization/107898 - ICE with -Walloca-larger-than X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/releases/gcc-12 X-Git-Oldrev: 09469705318de7a0fe5f10f5d5b92870d3fada6e X-Git-Newrev: 1a8af012222a8386fcda16a61dc17f11ba9cfbfd Message-Id: <20221212112108.634A63AA943D@sourceware.org> Date: Mon, 12 Dec 2022 11:21:08 +0000 (GMT) List-Id: https://gcc.gnu.org/g:1a8af012222a8386fcda16a61dc17f11ba9cfbfd commit r12-8979-g1a8af012222a8386fcda16a61dc17f11ba9cfbfd Author: Richard Biener Date: Tue Nov 29 09:03:46 2022 +0100 tree-optimization/107898 - ICE with -Walloca-larger-than The following avoids ICEing with a mismatched prototype for alloca and -Walloca-larger-than using irange for checks which doesn't like mismatched types. PR tree-optimization/107898 * gimple-ssa-warn-alloca.cc (alloca_call_type): Check the type of the alloca argument is compatible with size_t before querying ranges. (cherry picked from commit 9948daa4fd0f0ea0a9d56c2fefe1bca478554d27) Diff: --- gcc/gimple-ssa-warn-alloca.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/gimple-ssa-warn-alloca.cc b/gcc/gimple-ssa-warn-alloca.cc index 273b88ec141..23f63f066f5 100644 --- a/gcc/gimple-ssa-warn-alloca.cc +++ b/gcc/gimple-ssa-warn-alloca.cc @@ -217,6 +217,7 @@ alloca_call_type (gimple *stmt, bool is_vla) int_range_max r; if (warn_limit_specified_p (is_vla) && TREE_CODE (len) == SSA_NAME + && types_compatible_p (TREE_TYPE (len), size_type_node) && get_range_query (cfun)->range_of_expr (r, len, stmt) && !r.varying_p ()) {