From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by sourceware.org (Postfix) with ESMTPS id 2B4B03851C36 for ; Thu, 21 Jan 2021 18:24:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2B4B03851C36 Received: by mail-qt1-x830.google.com with SMTP id t17so2273464qtq.2 for ; Thu, 21 Jan 2021 10:24:45 -0800 (PST) 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-language :content-transfer-encoding; bh=rmTuW4Pj8dmuD/T8rLCC4JDQ/PS9vgurkS/pqTsPC50=; b=cbx+OTt1axUm8eQ4X6yYWrUBvTfPPp8Mji4R8hczvzARjNliPTa7SjEcQihOY/h9Bz FyOoA1a64hJ41gIceCjsvEKFgKmtlukoYU/g3OwgOUWeCGu/DNw4bOqlDA5topjg8iZa k7RrqC1agidPF+3kRY0vARq6ODSUWj0PGAuVD8fT02/WlehLOaQUCKHqKd3R0r4w2Js5 JL+PMGMH6fHX63+uL0GkFGdhfQhmC91CEd1P9uWDCxVntLJSKGL+gJpBmsNzjDNf8ljj Gim73I1oVMu7vNvocGNau7MlqkD6KCXj9BHLs9GjaAbx6hNKDXHT/zd33v8UA0rzlSXw 0wwg== X-Gm-Message-State: AOAM533L1O4R9JDdesmMhSfi75TVmOn5mvl8FSctnAwokt1vxzOdGhKV 2CfPdeSTCI6Qv02umTh5q/Xl/7XnH5I= X-Google-Smtp-Source: ABdhPJwvTepkiFHcKIIRmxYkCe4dmrlGKAsBWDRNDeoyErkfUEd9+nkoqc4GfdRdQ8gGH8/PNeEqHg== X-Received: by 2002:ac8:6f54:: with SMTP id n20mr861208qtv.65.1611253484066; Thu, 21 Jan 2021 10:24:44 -0800 (PST) Received: from [192.168.0.41] (184-96-239-30.hlrn.qwest.net. [184.96.239.30]) by smtp.gmail.com with ESMTPSA id o45sm1236407qto.91.2021.01.21.10.24.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Jan 2021 10:24:42 -0800 (PST) Subject: Re: [PATCH] improve warning suppression for inlined functions (PR 98465, 98512) To: Florian Weimer , Martin Sebor via Gcc-patches References: <2e49b6c6-a403-a207-c41e-58f78df96b84@gmail.com> <87h7natcqm.fsf@oldenburg.str.redhat.com> From: Martin Sebor Message-ID: Date: Thu, 21 Jan 2021 11:24:40 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <87h7natcqm.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, 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: Thu, 21 Jan 2021 18:24:46 -0000 On 1/21/21 10:34 AM, Florian Weimer wrote: > * Martin Sebor via Gcc-patches: > >> This patch depends on the fix for PR 98664 (already approved but >> not yet checked in). I've tested it on x86_64-linux. >> >> To avoid fallout I tried to keep the changes to a minimum, and >> so the design isn't as robust as I'd like it ultimately to be. >> I plan to enhance it in stage 1. > > I've tested this patch on top of 43705f3fa343e08b2fb030460f (so with the > PR98664 fix, I think), and the reproducer from PR98512 now ICEs: Thanks for giving it a try! I saw a similar ICE during my testing -- it's caused by a couple of uninitialized variables. I fixed it in my tree (see below) but the fix didn't make it into the patch. Please give this a try and let me know if it doesn't help: index abcd991b829..d82a7eb67e5 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -1426,7 +1426,7 @@ diagnostic_impl (rich_location *richloc, const diagnostic_metadata *metadata, int opt, const char *gmsgid, va_list *ap, diagnostic_t kind) { - diagnostic_info diagnostic; + diagnostic_info diagnostic{ }; if (kind == DK_PERMERROR) { diagnostic_set_info (&diagnostic, gmsgid, ap, richloc, @@ -1452,7 +1452,7 @@ diagnostic_n_impl (rich_location *richloc, const diagnostic_metadata *metadata, const char *plural_gmsgid, va_list *ap, diagnostic_t kind) { - diagnostic_info diagnostic; + diagnostic_info diagnostic{ }; unsigned long gtn; if (sizeof n <= sizeof gtn) Martin > > void * > __rawmemchr_ppc (const void *s, int c) > { > #pragma GCC diagnostics push > #pragma GCC diagnostic ignored "-Wstringop-overflow=" > #pragma GCC diagnostic ignored "-Wstringop-overread" > if (c != 0) > return __builtin_memchr (s, c, (unsigned long)-1); > #pragma GCC diagnostics pop > return (char *)s + __builtin_strlen (s); > } > extern __typeof (__rawmemchr_ppc) __EI___rawmemchr_ppc > __attribute__((alias ("__rawmemchr_ppc"))); > > during RTL pass: expand > t.c: In function ‘__rawmemchr_ppc’: > t.c:8:12: internal compiler error: Segmentation fault > 8 | return __builtin_memchr (s, c, (unsigned long)-1); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 0xde134f crash_signal > /home/bmg/src/gcc/gcc/toplev.c:327 > 0x9181bd diag_inlining_context::set_locations(vec*, diagnostic_info*) > /home/bmg/src/gcc/gcc/builtins.c:835 > 0x17ce2da update_effective_level_from_pragmas > /home/bmg/src/gcc/gcc/diagnostic.c:1028 > 0x17ce2da diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*) > /home/bmg/src/gcc/gcc/diagnostic.c:1218 > 0x17ceb1e diagnostic_impl > /home/bmg/src/gcc/gcc/diagnostic.c:1443 > 0x17cf144 warning(diagnostic_metadata::location_context&, int, char const*, ...) > /home/bmg/src/gcc/gcc/diagnostic.c:1669 > 0x917ab0 maybe_warn_for_bound > /home/bmg/src/gcc/gcc/builtins.c:4077 > 0x927eee maybe_warn_for_bound > /home/bmg/src/gcc/gcc/builtins.c:4920 > 0x927eee check_access(tree_node*, tree_node*, tree_node*, tree_node*, tree_node*, access_mode, access_data const*) > /home/bmg/src/gcc/gcc/builtins.c:4918 > 0x928b52 check_read_access > /home/bmg/src/gcc/gcc/builtins.c:4996 > 0x92e19b check_read_access > /home/bmg/src/gcc/gcc/builtins.c:9992 > 0x92e19b expand_builtin_memchr > /home/bmg/src/gcc/gcc/builtins.c:5926 > 0x92e19b expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int) > /home/bmg/src/gcc/gcc/builtins.c:9992 > 0xa6d714 expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) > /home/bmg/src/gcc/gcc/expr.c:11275 > 0xa796fb store_expr(tree_node*, rtx_def*, int, bool, bool) > /home/bmg/src/gcc/gcc/expr.c:5885 > 0xa7ab71 expand_assignment(tree_node*, tree_node*, bool) > /home/bmg/src/gcc/gcc/expr.c:5621 > 0x9569bb expand_call_stmt > /home/bmg/src/gcc/gcc/cfgexpand.c:2837 > 0x9569bb expand_gimple_stmt_1 > /home/bmg/src/gcc/gcc/cfgexpand.c:3843 > 0x9569bb expand_gimple_stmt > /home/bmg/src/gcc/gcc/cfgexpand.c:4007 > 0x95c60f expand_gimple_basic_block > /home/bmg/src/gcc/gcc/cfgexpand.c:6044 > > Thanks, > Florian >