From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by sourceware.org (Postfix) with ESMTPS id 82A663858D33 for ; Wed, 8 Nov 2023 02:24:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 82A663858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ventanamicro.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 82A663858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::52d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699410264; cv=none; b=D/wMfDhq3t5UDIY50x6FMGUJWSaHrqagt7dCFwoeNjkvP4U4uqiNY/Bmr/2WkP24KEtugFEKgb5klbu7UzJsAWJum0ehuEFtGJ5AlZ6RuPQHcLrZJ0RZa3qjA3WEHbqrP+8h0WjwEFejPsEHbhKD/h/z71AgKXYNBzv+A+qlyi0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699410264; c=relaxed/simple; bh=RwKbIEiJuwHVr9KE5GMGmS8YACXO10aqlwW86gOCpPU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=q7zKiQ83tyguxijicM6u28+yKbWgTn0wYL2PLTClwmZM1o2qKhAk18SYR3BbRLR8qzS5qA7tv5BVEQ/R7T/CuprgkcQ94R0baWVBS4TLsGXL/nBPPNSu7NL+oEt6Qy/ALK7HFpE3FWRfInN5xYuI588lDH7NxfSj2+feTZxrfFE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-5b99bfca064so4321202a12.3 for ; Tue, 07 Nov 2023 18:24:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1699410262; x=1700015062; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=lAhBMS51uuQ8oifTFJ7DRFdCf86gUSJ5BzpiTD3HxOc=; b=d8nRE83zpmvPKH/PoMj1TosQs7p3g2vmyrFp837O4MyLmxHLWEcpR2ffnVBw6A/dYQ FQNPZdNznLPwY5lKMO6PTgnMYicPBiXcPZM2Mjisgkur6YpwjfIVoG11nU1ZB2s0wPHP 4SGgJ0mjs6G466anjFTfapZoyUeShRT/BOYv2hfNvyaHTQ2U4pjQZytrzGJbxgk1dieh nvSigfa1IVCIJISzrS/jffKMV+UvCxqpBn4MQGo93vgcOD33b4VOUKKHyqUKavb2XMhM VaE5pOywunOoR8nl8B20er6ZM39luuT8XtEcFhRvgsPoe8CWK6KbT2E+F/2wkv87zqTR uTNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699410262; x=1700015062; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lAhBMS51uuQ8oifTFJ7DRFdCf86gUSJ5BzpiTD3HxOc=; b=sv55V2ygSrq9G1bTf+pgC0DTfa+Brs+rxmtL4YCpl0cgcFSN9RwiTRFUXxZCPhSK2Y sjg5jdvrqMKau5UrOY4NGq/F7vxsnoPWm8kEXhBruAy4P4rseWKnzF7gOrUIBJmR2kGi QeTIjg9jxN7cWHh6pp/z7I78zsab4UrIm344LbkJqp7ON2/zAPyCW8P/ECqj2zciKxi9 K2r4J93LTsdv0MzhmmQWflJHm3raysfqURCKxYaxy7EigCPeq8hH0VvzgeEOWPGL+YdG 0CO7DfLrECZKkGsjN9X9BX1ivxRLTasxqy64MqvmSzSge9qZjKjhtjAFooRB634eh+Ux 9DrA== X-Gm-Message-State: AOJu0YwVvHnj5F+cFavefktfrN/FRoyWsmXEv7RcGnZ1VUOBYUIWQvEk ro26INmcNSz3IKErBLen1vcMSi3Pkd8kYZfJCd8= X-Google-Smtp-Source: AGHT+IGppsI+sVqxMp/+0LA9bpM3qL/Lihvv265FQdYp22K28qOO8QxRQ/D6swOLB7v7Zr3YSd6yRw== X-Received: by 2002:a05:6a20:2445:b0:134:2b31:e2a9 with SMTP id t5-20020a056a20244500b001342b31e2a9mr974160pzc.0.1699410262364; Tue, 07 Nov 2023 18:24:22 -0800 (PST) Received: from [172.31.90.253] ([216.9.110.7]) by smtp.gmail.com with ESMTPSA id 15-20020a17090a190f00b002802d9d4e96sm510372pjg.54.2023.11.07.18.24.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Nov 2023 18:24:22 -0800 (PST) Message-ID: <822274bb-916e-4a23-8988-3c34533d72bc@ventanamicro.com> Date: Tue, 7 Nov 2023 19:24:21 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 07/12] mode-switching: Allow targets to set the mode for EH handlers Content-Language: en-US To: Jeff Law , gcc-patches@gcc.gnu.org, richard.sandiford@arm.com References: From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 List-Id: On 11/7/23 17:15, Richard Sandiford wrote: > Thanks for the reviews. > > Jeff Law writes: >> On 11/5/23 11:48, Richard Sandiford wrote: >>> The mode-switching pass already had hooks to say what mode >>> an entity is in on entry to a function and what mode it must >>> be in on return. For SME, we also want to say what mode an >>> entity is guaranteed to be in on entry to an exception handler. >>> >>> gcc/ >>> * target.def (mode_switching.eh_handler): New hook. >>> * doc/tm.texi.in (TARGET_MODE_EH_HANDLER): New @hook. >>> * doc/tm.texi: Regenerate. >>> * mode-switching.cc (optimize_mode_switching): Use eh_handler >>> to get the mode on entry to an exception handler. >> Can we ever have a path to the exception handler triggered by a normal >> control flow and if so, presumably we want this to apply in that case too? > > Not directly AFAIK. The handler has to handle the EH_DATA_REGNOs, > call __cxa_begin_catch, etc. So even if there is fall-through at > the source level, I think there'd always be a block that is only > reached through abnormal control flow. So... > >> It looks like that's the semantics of the implementation by way to using >> bb_has_eh_pred. Just want to make sure that's the semantics you want in >> that oddball case. >> >> Assuming it is the semantics you want, it's OK for the trunk, though you >> might want to twiddle the docs slightly to mention that case. > > ...I think these EH blocks are pure re-entry points. I suppose some > targets might have entities whose state is call-preserved, so that it's > not changed by EH edges. But that might also apply to other abnormal > control flow too, so it's probably a separate issue/feature. OK. I wouldn't be surprised if there's state that wouldn't be correct if we had code which jumped directly into the EH handler path. Makes me wonder if the C++ language might actually prohibit such shenanigans. Jeff