From patchwork Wed Feb 20 21:40:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 1045572 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-496763-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="i49Cwmam"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="b3PedPcD"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444WJ05vpQz9s6w for ; Thu, 21 Feb 2019 08:41:03 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=I+A8U0ysAFn7RLRpwdYv5O9Bt0sefQVDhHgIYlcVrx5N3p 4LfYC4JMNr8P9A0bv5W3Nney0bdA/WQtcf6XAEU5InBfjeOgbXJq3GNtSEdnIDg3 20lZ6E1XUSbi4Snfxw3tBXm27fXOjuyuysiatI3PUu8F2bQvTr/0L7LdLzx2w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=0rwEtfaq5mL0BYqpQ94BU9xXea0=; b=i49Cwmam5YQ3/zvUsPA7 lz6bzfXZ337VzluEZJl0sYn5K4jjqwRbMOgpjg6P+8ZVaexSCyEO2Z7SMsw3xdPJ NNDmrPB95xGifr1ilc3nPFm7DgWFXnV30KNRNsBQK99u1xQZg2P7D+YU/6vHuf52 PxdylPGk42vyc1PxTHUdyZI= Received: (qmail 59540 invoked by alias); 20 Feb 2019 21:40:55 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 59523 invoked by uid 89); 20 Feb 2019 21:40:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-it1-f169.google.com Received: from mail-it1-f169.google.com (HELO mail-it1-f169.google.com) (209.85.166.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Feb 2019 21:40:53 +0000 Received: by mail-it1-f169.google.com with SMTP id g137so7609318ita.0 for ; Wed, 20 Feb 2019 13:40:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=1vA+pGfsWxtarKlK47ycACKWsu8ht3aCbqb0ZtfGzZk=; b=b3PedPcDN06vM3Dl/imAiZHYrg5jUH3dum7Jsxd0pNFsrYQZE3XCrAlBkYMN0S4jhC 7Kc4zMXiFZ1MqUBKwUp1khqQ+oZdQB5dYJp29fN751av7oeY4Y9nnERD74dD5TT0JEry izE3mCSO5qSuyDr/vpD2rUh9xebR4sEwjYnnG2njTPxQf7e9TzJKJJ7xJ4EAg++fmeLx Ia82b+l98R/9rHPsamh9qLNxqJMYCEB6ry4HN8YmICb4zbj3005NG6I0SnyFZ0TfiaQD Z8cY/xewKhZYMZyvKnG8zvw91RvzHh7OB7QVsdZyR0KKPqppKehNaP6nFXjk3qQhsKm7 e+1g== MIME-Version: 1.0 From: Uros Bizjak Date: Wed, 20 Feb 2019 22:40:38 +0100 Message-ID: Subject: =?utf-8?q?=5BPATCH=2C_alpha=5D=3A_Avoid_warning=3A_assignment_to?= =?utf-8?q?_=E2=80=98struct_sigcontext_*=E2=80=99_from_incompatible?= =?utf-8?b?IHBvaW50ZXIgdHlwZSDigJhtY29udGV4dF90ICrigJk=?= To: "gcc-patches@gcc.gnu.org" Attached patch implements the same approach that x86_64 implements to properly cast 'mcontext_t *' &rt_->uc.uc_mcontext to 'struct sigcontext *'. BTW: Other targets (e.g. Mips) probably need similar patch to avoid warning. 2019-02-20 Uroš Bizjak * config/alpha/linux-unwind.h (alpha_fallback_frame_state): Cast 'mcontext_t *' &rt_->uc.uc_mcontext to 'struct sigcontext *'. Tested on alphaev68-linux-gnu and committed to mainline SVN. Uros. diff --git a/libgcc/config/alpha/linux-unwind.h b/libgcc/config/alpha/linux-unwind.h index ec75c793454a..482564910f87 100644 --- a/libgcc/config/alpha/linux-unwind.h +++ b/libgcc/config/alpha/linux-unwind.h @@ -53,7 +53,10 @@ alpha_fallback_frame_state (struct _Unwind_Context *context, siginfo_t info; ucontext_t uc; } *rt_ = context->cfa; - sc = &rt_->uc.uc_mcontext; + /* The void * cast is necessary to avoid an aliasing warning. + The aliasing warning is correct, but should not be a problem + because it does not alias anything. */ + sc = (struct sigcontext *) (void *) &rt_->uc.uc_mcontext; } else return _URC_END_OF_STACK;