From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.ispras.ru (winnie.ispras.ru [83.149.199.91]) by sourceware.org (Postfix) with ESMTP id 85BE03851C05 for ; Mon, 8 Jun 2020 13:48:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 85BE03851C05 Received: from monopod.intra.ispras.ru (monopod.intra.ispras.ru [10.10.3.121]) by smtp.ispras.ru (Postfix) with ESMTP id 6C7C1203C1; Mon, 8 Jun 2020 16:48:03 +0300 (MSK) Date: Mon, 8 Jun 2020 16:48:03 +0300 (MSK) From: Alexander Monakov To: Lars Poeschel cc: gcc-help@gcc.gnu.org Subject: Re: Unexpected unaligned access on arm In-Reply-To: <20200608133411.uwe4c4nt2h4zvnjq@lem-wkst-02.lemonage> Message-ID: References: <20200608133411.uwe4c4nt2h4zvnjq@lem-wkst-02.lemonage> User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 13:48:06 -0000 On Mon, 8 Jun 2020, Lars Poeschel wrote: > What am I missing ? What am I doing wrong ? The field struct in_addr ip_src; is 4-byte-aligned, forcing the containing structure to also be 4-byte aligned. >From that the compiler deduces the minimum required alignment of individual members. Alexander