From patchwork Sun Nov 3 22:22:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lewis Hyatt X-Patchwork-Id: 2005824 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=C1n0hADh; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XhTgN06ZVz1xxN for ; Mon, 4 Nov 2024 09:25:04 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3081B385AC09 for ; Sun, 3 Nov 2024 22:25:02 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by sourceware.org (Postfix) with ESMTPS id 71C303858C39 for ; Sun, 3 Nov 2024 22:22:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 71C303858C39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 71C303858C39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::f35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730672592; cv=none; b=E9O8+U0NfF2LdHS2XFqZJQYUKAt224djFWHvIGA0uFo0GiycC7INzuaQlr2kg+8grYUYKpAuQjmW8jH46AVt3nNpwtkFynF4tYqgCxCzDxbfdC+R1klNrvzdzIQia1uXuw+FEuFiplye+YXMttV3e9FoBc/Ab2WKNETy7oZg1R4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730672592; c=relaxed/simple; bh=O/m3rli9bxBDc2QHbd6W+wXFHgbAX4/QmJAoLAJvKWo=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=GXJWC8IyshIO6bdcJRoUIGyeEDTrJ0lSl8XOPE8no2/hxTr69UVy4gI+dwmwAHMcSGmKpIpe7qyuDnpNKmRIosxjt9SRApZ1e/Lsud6nfh0M+eEu2nRPqSufXNLDtj2R+L6nN8njTutQEBVKK10cO7PU27TggiXAaQEHjo8HuQ4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-qv1-xf35.google.com with SMTP id 6a1803df08f44-6cbcc2bd7fcso25872986d6.1 for ; Sun, 03 Nov 2024 14:22:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730672579; x=1731277379; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pYJyy/13reXidBj7+M0wAVdYimasvXNF/du/f6xRqTQ=; b=C1n0hADhRDz5/z1uG6oOvKD1pRcDS2sD4baJ0RyumDTj0uvRZ3RAcacehXKuYk5Twf h48Co7/JddPaNEk9zE1AnB8hwWClbEHUcm+2BV2QzqQDwxG/PuBqeiglcEiCF3SqJz7S +JU9NjFBO3h1c5H9hgHCiIj0/rx4kUn8WLYxW1+MXb3KQ0Ep/PhXmYP9FWfvDIwx/kpL xDaHTMH/6BlW9DdAzygVDszXx9xh6jd7Ei0Ox0TmojMiYFvUzBpu6ueBW7LXqnWhj6KU D8rqTUQo5rl+L/tMbvIHLtfJN1pO91RLFzvj7NTvWPRUEN5d7copJDis6k35oEk1KcKl 1gaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730672579; x=1731277379; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pYJyy/13reXidBj7+M0wAVdYimasvXNF/du/f6xRqTQ=; b=Am0t1MN2UEn+8jKO+/r0dHTWa27nNh+KnQwaJEsyNKvNEOSgjPEosGzBBOiLzooGcJ epED8Lx0vfMltdOPSx7MSvt999ZWwvulDOkvnxVmmWteWyrQ0YLLXBk0CbalbekzFZbA 5Zhbc+m4z3VDUYfDTQTx1TjDlSizHPN6EB/y6/Hnp83qTA8cB/11EHDYXaRePX6xrnGp ZbyczWMlzpH31pQl0xvZLc6k3KQGNGGBHBcHgKxEHy5LroAidn2M6FfzMWYSjTL+fAbL ExpqJ7etSI7ciw/NnEQSmYiYL7dTG6U8OZD+0SD0iZOfqkx0rVyp8ppxILMrpxKqN5sq +uwg== X-Gm-Message-State: AOJu0YyL3w/wnl0ewkgKdP+iudn7hrho85D98v/VZ5cMQkc7tOElpOwR PYU/th3P3UjHZ8SMbZtM+YBwhia7biPDDfEPB0X6xqkwBCXhtvEJZaCEBg== X-Google-Smtp-Source: AGHT+IFskeg9so6ElA3+BD1LvVHoFvWcs890cd8q0/UhpP1l8IOS8KSciA4wVJ1miWuoWCNTax/+rA== X-Received: by 2002:a05:6214:588a:b0:6cb:be8f:a6b1 with SMTP id 6a1803df08f44-6d351ac399amr209690546d6.25.1730672578648; Sun, 03 Nov 2024 14:22:58 -0800 (PST) Received: from localhost.localdomain ([173.54.240.58]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6d35415b2fesm42025866d6.92.2024.11.03.14.22.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Nov 2024 14:22:57 -0800 (PST) From: Lewis Hyatt To: gcc-patches@gcc.gnu.org Cc: Lewis Hyatt Subject: [PATCH 12/15] Support for 64-bit location_t: Backend parts Date: Sun, 3 Nov 2024 17:22:17 -0500 Message-Id: <20241103222220.933471-13-lhyatt@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241103222220.933471-1-lhyatt@gmail.com> References: <20241103222220.933471-1-lhyatt@gmail.com> MIME-Version: 1.0 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org A few targets have been using "unsigned int" function arguments that need to receive a "location_t". Change to "location_t" to prepare for the possibility that location_t can be configured to be a different type. gcc/ChangeLog: * config/aarch64/aarch64-c.cc (aarch64_resolve_overloaded_builtin): Change "unsigned int" argument to "location_t". * config/avr/avr-c.cc (avr_resolve_overloaded_builtin): Likewise. * config/riscv/riscv-c.cc (riscv_resolve_overloaded_builtin): Likewise. * target.def: Likewise. * doc/tm.texi: Regenerate. --- gcc/config/aarch64/aarch64-c.cc | 3 +-- gcc/config/avr/avr-c.cc | 3 +-- gcc/config/riscv/riscv-c.cc | 3 +-- gcc/doc/tm.texi | 2 +- gcc/target.def | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/gcc/config/aarch64/aarch64-c.cc b/gcc/config/aarch64/aarch64-c.cc index f9b9e379375..fff10337fb3 100644 --- a/gcc/config/aarch64/aarch64-c.cc +++ b/gcc/config/aarch64/aarch64-c.cc @@ -365,11 +365,10 @@ aarch64_pragma_aarch64 (cpp_reader *) /* Implement TARGET_RESOLVE_OVERLOADED_BUILTIN. */ static tree -aarch64_resolve_overloaded_builtin (unsigned int uncast_location, +aarch64_resolve_overloaded_builtin (location_t location, tree fndecl, void *uncast_arglist) { vec empty = {}; - location_t location = (location_t) uncast_location; vec *arglist = (uncast_arglist ? (vec *) uncast_arglist : &empty); diff --git a/gcc/config/avr/avr-c.cc b/gcc/config/avr/avr-c.cc index d3c40d73043..7cf8344c1c7 100644 --- a/gcc/config/avr/avr-c.cc +++ b/gcc/config/avr/avr-c.cc @@ -48,11 +48,10 @@ enum avr_builtin_id /* Implement `TARGET_RESOLVE_OVERLOADED_PLUGIN'. */ static tree -avr_resolve_overloaded_builtin (unsigned int iloc, tree fndecl, void *vargs) +avr_resolve_overloaded_builtin (location_t loc, tree fndecl, void *vargs) { tree type0, type1, fold = NULL_TREE; avr_builtin_id id = AVR_BUILTIN_COUNT; - location_t loc = (location_t) iloc; vec &args = * (vec*) vargs; switch (DECL_MD_FUNCTION_CODE (fndecl)) diff --git a/gcc/config/riscv/riscv-c.cc b/gcc/config/riscv/riscv-c.cc index c59f408d3a8..7f78e2cf019 100644 --- a/gcc/config/riscv/riscv-c.cc +++ b/gcc/config/riscv/riscv-c.cc @@ -312,11 +312,10 @@ riscv_check_builtin_call (location_t loc, vec arg_loc, tree fndecl, /* Implement TARGET_RESOLVE_OVERLOADED_BUILTIN. */ static tree -riscv_resolve_overloaded_builtin (unsigned int uncast_location, tree fndecl, +riscv_resolve_overloaded_builtin (location_t loc, tree fndecl, void *uncast_arglist) { vec empty = {}; - location_t loc = (location_t) uncast_location; vec *arglist = (vec *) uncast_arglist; unsigned int code = DECL_MD_FUNCTION_CODE (fndecl); unsigned int subcode = code >> RISCV_BUILTIN_SHIFT; diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 4deb3d2c283..4b739578f4f 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -12108,7 +12108,7 @@ ignored. This function should return the result of the call to the built-in function. @end deftypefn -@deftypefn {Target Hook} tree TARGET_RESOLVE_OVERLOADED_BUILTIN (unsigned int @var{loc}, tree @var{fndecl}, void *@var{arglist}) +@deftypefn {Target Hook} tree TARGET_RESOLVE_OVERLOADED_BUILTIN (location_t @var{loc}, tree @var{fndecl}, void *@var{arglist}) Select a replacement for a machine specific built-in function that was set up by @samp{TARGET_INIT_BUILTINS}. This is done @emph{before} regular type checking, and so allows the target to diff --git a/gcc/target.def b/gcc/target.def index 523ae7ec9aa..e285cef5743 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -2497,7 +2497,7 @@ arguments passed to the built-in function. The result is a\n\ complete expression that implements the operation, usually\n\ another @code{CALL_EXPR}.\n\ @var{arglist} really has type @samp{VEC(tree,gc)*}", - tree, (unsigned int /*location_t*/ loc, tree fndecl, void *arglist), NULL) + tree, (location_t loc, tree fndecl, void *arglist), NULL) DEFHOOK (check_builtin_call,