From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2C4DF3858D32; Mon, 24 Apr 2023 10:10:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C4DF3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682331050; bh=8e4QnlPuHe7kXQiJtb4YzOKUqt5Sm855xnPNOCzrc9Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=E3nA+FlpKuE31zBTvkHBgdI0X4ISUbqucPS5tCF1CAJ93KpFb5NlRp9apNs3sB1aF 2akp9jlTinKTaiBmAlY95eiXvIOk3dgT+I6dc8WkwfSuozyhEFJiUcloRosHj4lfKH LXu5XEEyWqNgs3bsboNOKcJ10DhqacqDNWvv2AZM= From: "avieira at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109543] Avoid using BLKmode for unions with a non-BLKmode member when possible Date: Mon, 24 Apr 2023 10:10:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: avieira at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109543 --- Comment #2 from avieira at gcc dot gnu.org --- Sorry for the delay. Here's the typedefs with GNU vectors.=20=20 typedef struct=20 { float __attribute__ ((vector_size(16))) v[2]; } STRUCT; #ifdef GOOD typedef STRUCT TYPE; #else typedef union { STRUCT s; double d[2]; } TYPE; #endif To be fair I suspect you could see similar behaviour with just 16-byte vect= ors, but with aarch64 the backend will know to use 64-bit scalar moves for 128-b= it BLKmodes, though even then, picking the vector mode would result in more optimal (single vector move) code.=