From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D19823019A0 for ; Mon, 15 Sep 2025 15:00:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=63.228.1.57 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757948446; cv=none; b=JcQ1tgQ/CkDIc8r1njbjDyZeMHhfz2qFIH/EZEEnNTrbTzfDiASMYr1TRFPfadEI5Z7fLYIUXtSokfnXi12RFhq2hG0qTzAciUP6xAfCA63cO1GzNE0bJIotD17BAtrmRIyVxYrwXQhnZ5DrVxPinVdM53ogb6+AKIAZQCsvlOM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757948446; c=relaxed/simple; bh=aWr4UhRURD+gGRLmja8WvWBMsk4/mFWxq6A1ayLjpDY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VwbzHWLI7jFGqlsWwfBmnLqw6RTKCSQvlxTJJlZ9c4saxsgJRQUX/ebk+3sVNlPD3hXW0KYZ19MT5KJxwp3KXN3kcW9YzZC4R6RgIfWXNQZO0mtNKS4BfBv/zlrD7lbHl5f3g9lrjFBsMNYZke0I3SDXepmKF/UnpTC3IcuCt3c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org; spf=pass smtp.mailfrom=kernel.crashing.org; arc=none smtp.client-ip=63.228.1.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost [127.0.0.1]) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 58FF03FH202747; Mon, 15 Sep 2025 10:00:03 -0500 Received: (from segher@localhost) by gate.crashing.org (8.18.1/8.18.1/Submit) id 58F98YGH184903; Mon, 15 Sep 2025 04:08:34 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 15 Sep 2025 04:08:29 -0500 From: Segher Boessenkool To: Jan Beulich Cc: Rainer Orth , Indu Bhagat , "linux-toolchains@vger.kernel.org" , Jens Remus Subject: Re: Unaligned access trade-offs for SFrame FRE layout Message-ID: References: <9d104c46-855c-4b36-8226-1f59b59e455c@suse.com> <26895e7a-5d54-4c89-aeb4-bcd094ba081d@suse.com> Precedence: bulk X-Mailing-List: linux-toolchains@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <26895e7a-5d54-4c89-aeb4-bcd094ba081d@suse.com> On 14.09.2025 16:39, Rainer Orth wrote: >> On 12.09.2025 19:34, Indu Bhagat via Binutils wrote: > look for STRICT_ALIGNMENT in the GCC sources in gcc/config. While > several are embedded targets, there's also sparc in that list. > > But is this setting a good reference for the purpose here. It is not a setting usually, also not for you, it is a command-line option. Often it is good (for performance) to only do naturally aligned accesses. For some (sub-)archs it simply is impossible to even try to do misaligned accesses OTOH. > It's okay for gcc to make assumptions (assuming they're properly > documented), Only some implementation decisions have to be documented. And assumptions are almost never okay. Typically we depend on the user promising they do not do X (via a -mno-X flag, say) before we assume they do not do X. Segher