From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id 191183858C78 for ; Tue, 19 Dec 2023 03:54:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 191183858C78 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 191183858C78 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::634 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702958058; cv=none; b=QKLOFoLb++QR+YFKDeqIT9rSK5OACxebFEA1/c3yal2SBAot5z2OicprAOEESGdxCjCMJqcu0AF8R2wm98TOiIFdy1BML58qtwzPUzhObY5ykkL/R5B09mZuGUKMCo+b+dLRO7OUqgDwgfjJQYcuAEki72Ge5fvSqAbaxKsguFw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702958058; c=relaxed/simple; bh=mtmG7kIy+PJDfNjUe2cojv/TgIDGlW0IVjauf+Dg+1I=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=iXGYqCbti2cffiwL8L6f0eA315CjD1lzMgy5sV9Sg+ywSfkAFTOk3weVKUUnf73zfbd3wTSfvPPCyVmMAcT1gaq+AXAYGXfbFFlGkG1dlnv/qqHYhXnpwiIfQM3apQ0YKftZTLaWaTcrL/p3VG8/xTIWz4lahcPVOhEmPh5a8+U= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1d075392ff6so27851365ad.1 for ; Mon, 18 Dec 2023 19:54:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1702958055; x=1703562855; darn=gcc.gnu.org; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=+QuQLfkNvNf9EXUoI0t6rbCDMfplXvXMSdLspROpyDg=; b=evLO0Sm8N/TnH15M/1gB3Xc3n4r2UROYHjnbA5HnHIv3nxh7bORjujOzze4VrDCX69 7CXqICHx/JhNi1S3XQXBZTdPrbRsXGmfsRK8R667SJh8wvf5MMGUOWPH94KeiH6SllL9 IJIyNtp/ejDHZc+0pG5GGb1W6fGt3GLGmuPKVQw/KpCEL3tkTz5X/a/snOMH6RKPV8Vr G+HdEh2miBsbOvmi+5+QCYb0ojsjY+/8saaHhaIBunWP/apf900y9msxFLArnbEfiXrP XNTihoNvRUytlkAP7xhg4X8loLSk9Yj5DoimK77NGooF+yJIY483+YJ1t8fAKGVjR57U zmIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702958055; x=1703562855; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+QuQLfkNvNf9EXUoI0t6rbCDMfplXvXMSdLspROpyDg=; b=hgtO11ZABNa7U+P+VJ4Ehdqsg8r2OXUQLKxjVKo+vNO60ONnZggdEIBSFVzt1vCeRq 9qqZOEOglIMga3LFETFtufSR2znrTZXjac/uyT4wV/Jphxm74qjWLYJnpXOY5g1qjqvG /OmSyzYcie9iMLyhl5T9o5t5+Kn7seRSa47e50VjhuzwSOtzQrqqoa1dztkAbysLG6RN 0H6S4aZ2bn2oUnsbovI+P4DQSeExK24mx4llTaDsIKGt+haIqvUYCx6Gi1+6zN5S6W5n fpy32d3wGqN8csdo6YOQ8waQ0UoFFdvBodlUrAUt7m8zkMidEq1yjVf1sR/L8PMDjMf1 /DEA== X-Gm-Message-State: AOJu0YzyjW+/O9OiFgHvgubv0DWM1OiNU7QPKlG7Tyh0BpRDB00akUn0 GucrK24w8to0zCeZDXUdE6J8IA== X-Google-Smtp-Source: AGHT+IE+V4kHIf6O3f5xUa/PW45DInRQ9BH5fzQGOcdIcomYnfQa5Or2DUqwovyRT2Bv/CeTgnGfOA== X-Received: by 2002:a17:903:2304:b0:1d0:6ffd:610d with SMTP id d4-20020a170903230400b001d06ffd610dmr524069plh.47.1702958054900; Mon, 18 Dec 2023 19:54:14 -0800 (PST) Received: from free.home ([2804:7f1:2080:dd67:1c01:ac85:7bb4:256d]) by smtp.gmail.com with ESMTPSA id h2-20020a170902f54200b001cfc67d46efsm19657168plf.191.2023.12.18.19.54.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 19:54:14 -0800 (PST) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 3BJ3s3ad642774 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 19 Dec 2023 00:54:04 -0300 From: Alexandre Oliva To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] strub: use opt_for_fn during ipa Organization: Free thinker, does not speak for AdaCore References: <34r50573-433n-4679-312p-271o551pq47n@fhfr.qr> Date: Tue, 19 Dec 2023 00:54:03 -0300 In-Reply-To: <34r50573-433n-4679-312p-271o551pq47n@fhfr.qr> (Richard Biener's message of "Fri, 15 Dec 2023 08:08:15 +0100 (CET)") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-4.9 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,WEIRD_QUOTING 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 Dec 15, 2023, Richard Biener wrote: > You have to be generally careful when working within IPA > with function bodies without push/pop_cfun around that, several APIs > have variants with struct function sepcified, using the wrong one > will get you a NULL cfun which _some_ of them handle gracefully and > "wrong", all EH stuff is amongst this for example. *nod*, I recall running into that, and finding some APIs that required push/pop_cfun, so since I was implementing strub so that it could be plugged into an existing compiler, I didn't give much thought to introducing alternate APIs that could. IIRC I first hit something about EH, and then I had to put in push/pop_cfun. That was very early on, so after that I may have used implicit-cfun APIs without getting ICEs. I suppose now that strub is in pursuing push/pop_cfun avoidance could be a nice cleanup. > I see you replace flag_exceptions with opt_for_fn (cfun->decl, > flag_exceptions), given that's 'cfun' this replacement is a no-op > given 'cfun' would be NULL in IPA context unless you pushed a function. > Looking at the 2nd hunk and the caller it seems the transform is > a no-op for indrect_calls but not callees, thus that hunk is OK. Yeah, I figured that was the reason behind your recommendation, but I guess adding explicit uses of cfun (rather than passing a function around) doesn't really make things much better, except inasmuchas it enables a future de-cfun-ification of strub passes to be a little more mechanical. -- Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ Free Software Activist GNU Toolchain Engineer More tolerance and less prejudice are key for inclusion and diversity Excluding neuro-others for not behaving ""normal"" is *not* inclusive