From patchwork Fri Jan 12 14:12:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 187748 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp199074dyc; Fri, 12 Jan 2024 06:13:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJDPEmCTqC77I1gnmddi2hXSfeIVpoOKp+2hmc2hdXAyri6p/ZwNGUSJGBwIHVnPg2SpmY X-Received: by 2002:a05:622a:cc:b0:429:bb91:6f0 with SMTP id p12-20020a05622a00cc00b00429bb9106f0mr1790271qtw.37.1705068796266; Fri, 12 Jan 2024 06:13:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705068796; cv=pass; d=google.com; s=arc-20160816; b=c+wG2bGAZLE6RrJJW3jF9GoNJzNN6yPb7ezgWoD4X6F6wC6wZK5dg4DWz5Zm1jjheU lu692zPvEkJVUVkf/yI1XxtBAPxEPxPMfIj9Do0o/JC1Gvowr1xi2enRKL317KezNFPt AYjMuKhnieyCNmLpRibE/zz6G3tbsDDQFgi/Fmc9nPQD/VwEdoszJnXllH1/ORflxadG vOvtBXHluhWGpPVEcHlTPfb3nlwfIPGqAyqTHA9UcFwNpKOaKrim0k75YxQ/FQw/6JNc vP4Z1QVXaVIZGtUb4CCXC2r9df4yo2sUZffijp8vVG/afmSbatY4nNRfeurN378jJg7A QYRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=xclUsY8hz8VKDoy1HVeJvkR/rji3KwlpMjiSBvpoo7o=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=f83n59QluUDy8vIrRcehsuMLgoyxDOfRXdJS/L7FHEBTbGEq1A5ejWjfTwVxx0buV6 gyz8Vc29TWSHKZlVlLjh3SaWHuPA796TzuOMyOBfYDGd64X8AsXAaw5oVzNgIyOtjq7A /RS2wIek+Q3l8eDHS8kTwO8jAucenqoqQYkBBWGK0LjByNYhf4XRcBjHO+wSB+0Kd6Tw 91J92HpNqj04ZEKzOY4GGNFb+Oz0c968GJw5bsTt1Ife0ZGUHqtMzdI+PLH7QRyXiu3+ opyh/YWxr/seIPWs/7YccjVliAUKisDPyVT3tJPRZ4FeYOqBlLfuWLZwb/DfKbWeoyVH j2kQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VjfUqhgE; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id w2-20020a05622a190200b00429b8cf9a8esi3121248qtc.11.2024.01.12.06.13.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 06:13:16 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VjfUqhgE; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F298F385829F for ; Fri, 12 Jan 2024 14:13:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id D8AB23858C2F for ; Fri, 12 Jan 2024 14:12:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D8AB23858C2F 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 D8AB23858C2F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705068756; cv=none; b=cA0el+lVeZGEgqKV7Tr6K2H9dQAgCh//wCAqAs4BqS8Q9I61sANBAtfO5fIonBTwm3E7/Fe5esS7NyLfEVPptGYV0qtQuF8DVZYaQCbwN//TEVAEWLuuln4Tf47h2kBOT1NHhu4MfdY6C/pBgybS0qIn41mbm2HhxVjKiqr1oWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705068756; c=relaxed/simple; bh=54gah6h5KY0f4e3m4mDfi7Oz1apaR6HoAUMCW0Uzcm0=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=r9943XJFgB4Ac4Mr642tey4aUiw7wjcCtFgrFZeSO06YDqyTeuDuKcSUP5IQ7EKZWFYfQSCj/yW+aRqGx0S1KjCw4RWP2Ae/ExunATePBKLKVIFbM34Mi/gzY4B7dGP0kNBIbFyH8xXhhsf1+JedbIIPDwSDWr4SNl/vLKRiH8E= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40e68ca8e27so1800405e9.1 for ; Fri, 12 Jan 2024 06:12:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705068751; x=1705673551; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=xclUsY8hz8VKDoy1HVeJvkR/rji3KwlpMjiSBvpoo7o=; b=VjfUqhgEoSsFbBh/MSFiRpQQVXVLklOi71vBXuOSreJXO0AfaxrFU7efmMyph+EwD+ a6i14WrZ6O+Taej7Q7Jw+QyN0MB6FTaW8SfqRdDyQctbufF0kNO5NW23M8phmXeNwxya vw5UQOsaaZBS9YVYjXZEHnUz7TsZwlRxMEx0rf42/wLwHedP0dWOkwsKO1fMdthZNZ1U zXMWW6ktxyXndiTaylFux/jzl/oEjnW+W1cTtAxHaF8ZRzZ0tERpbGKzedyfrQ6kQFHY sDnGtfw53Pes63jGWSxJ3tvKcgwDSAVtdue0Hv9J1eBXhALSI6us9BA6s9P+bKoLiho/ rVgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705068751; x=1705673551; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xclUsY8hz8VKDoy1HVeJvkR/rji3KwlpMjiSBvpoo7o=; b=i7BUdEVHVR+URCwID+FdlsQ6rGvcdocJNeNX4pqX2V33zIPMcJQCLNZVKSlR8guQZH I/gIeBrYPLszcq786zVZdxJ4LglhIZivUQ8SIwRPvupubWsvusueo8AtfLHi/HC924TE GpDTQUFtUucndmAgzTQsQjF5v0bVudq5JcZw7wZc1L6EsvYTdves0lxMf5X91mUD+fx+ IqLoMGSgpElRXhHPtZ3m0zF+68/s1d/e/BwBkalZgzcqfHEun3bM2TvF3ia2WnnEhm4C n5j8h9pDhfGuTAQXbehwextAGl2tAS4AT3KBUtcAnAk8dHxP+8sAv1u/xUu8ZEzELTgM yClQ== X-Gm-Message-State: AOJu0YztY08L2g69Pc/DsARkVmDxZVE48cvYG9dUKRwwUNrnRMuVzHpW gQJxFeJTnl3e8BPKP8yiFN82GNlJVbw= X-Received: by 2002:a05:600c:20b:b0:40c:6555:8faf with SMTP id 11-20020a05600c020b00b0040c65558fafmr778240wmi.180.1705068751117; Fri, 12 Jan 2024 06:12:31 -0800 (PST) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id m15-20020a7bce0f000000b0040d23cea7bcsm3629474wmc.1.2024.01.12.06.12.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 12 Jan 2024 06:12:30 -0800 (PST) From: Iain Sandoe X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [pushed] Objective-C, Darwin: Fix a regression in handling bad receivers. Date: Fri, 12 Jan 2024 14:12:30 +0000 Message-Id: <20240112141230.62685-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.39.2 (Apple Git-143) MIME-Version: 1.0 X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , Reply-To: iain@sandoe.co.uk Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787894218140903894 X-GMAIL-MSGID: 1787894218140903894 Tested on i686 and powerpc darwin, and a cross from x86-64 darwin to powerpc, pushed to trunk, thanks, Iain --- 8< --- This is seen on 32b targets with a 64b multilib, and is an ICE when the build has checking enabled. The fix is to exit the routine early if the sender or receiver are already error_mark_node. gcc/objc/ChangeLog: * objc-next-runtime-abi-02.cc (build_v2_objc_method_fixup_call): Early exit for cases where the sender or receiver are known to be in error. Signed-off-by: Iain Sandoe --- gcc/objc/objc-next-runtime-abi-02.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/objc/objc-next-runtime-abi-02.cc b/gcc/objc/objc-next-runtime-abi-02.cc index dfc1129530a..a622f4cbf4e 100644 --- a/gcc/objc/objc-next-runtime-abi-02.cc +++ b/gcc/objc/objc-next-runtime-abi-02.cc @@ -1657,6 +1657,8 @@ build_v2_objc_method_fixup_call (int super_flag, tree method_prototype, rcv_p = (super_flag ? objc_super_type : objc_object_type); lookup_object = build_c_cast (input_location, rcv_p, lookup_object); + if (sender == error_mark_node || lookup_object == error_mark_node) + return error_mark_node; /* Use SAVE_EXPR to avoid evaluating the receiver twice. */ lookup_object = save_expr (lookup_object);