From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1B09E3858427; Fri, 26 Aug 2022 17:31:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B09E3858427 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661535064; bh=3dkinQt+VN+veEkBy0AinzjRs1KdMbfVbqdeU9Dud5E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vSOchp7Bq74SCEJGNJcQXlw+ye9QA71Kmbxrl6YHsdqT2GcYPjCOSdGXlS/43MUwJ 35ssGz4Mmyj2pwlNBSf0L95bfmMXMHfJX31b74QW09ENJs3TPXIyTF7SqNkXvWBiuD xu+AARU24UbOdIg6kccfyC/3rvikZR+hEERTYhZw= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106755] Incorrect code gen for altivec intrinsics with constant inputs Date: Fri, 26 Aug 2022 17:31:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: blocker X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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: resolution bug_status 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=3D106755 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|NEW |RESOLVED --- Comment #3 from Andrew Pinski --- (In reply to Peter Bergner from comment #2) > That said, -Wall and -Wstrict-aliasing do not flag > any warnings with the code. I suppose they could miss some issues in the > test case code??? typedef __vector unsigned int vui32_t; ... typedef __vector unsigned __int128 vui128_t; ... static inline vui128_t vec_muludq (vui128_t *mulu, vui128_t a, vui128_t b) { ... *mulu =3D (vui128_t) t; ... int test_muludq (void) { vui32_t i, j, k, l /*, m*/; .... k =3D (vui32_t) test_vec_muludq((vui128_t* )&l, (vui128_t)i, (vui128_t)j); .... print_vint128_prod ("2**96-1 * 2**96-1 ", k, i, j, l); So yes there is aliasing violation as you do the store as vui128_t aka "__vector unsigned __int128" (which has the same aliasing set) as "__int128" but then do the load from it as vui32_t aka "__vector unsigned int vui32_t" (which is the same aliasing set as int).=20 -Wstrict-aliasing=3D3 might warn about this case I can't remember exactly o= f the levels of the options but the -Wstrict-aliasing warnings are always not goi= ng to happen, sometimes it is easier to read the code.=