From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23326 invoked by alias); 12 Jan 2005 18:00:36 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 23134 invoked by uid 48); 12 Jan 2005 18:00:20 -0000 Date: Wed, 12 Jan 2005 18:00:00 -0000 Message-ID: <20050112180020.23133.qmail@sourceware.org> From: "jakub at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050105125215.19263.smelkov@mph1.phys.spbu.ru> References: <20050105125215.19263.smelkov@mph1.phys.spbu.ru> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/19263] [3.4/4.0 regression]: wrong-code: explicit inicialization of v8qi miscompiled X-Bugzilla-Reason: CC X-SW-Source: 2005-01/txt/msg01548.txt.bz2 List-Id: ------- Additional Comments From jakub at gcc dot gnu dot org 2005-01-12 18:00 ------- This seems to be because of the CONSTRUCTOR_ELTS (init) = NULL; added in http://gcc.gnu.org/ml/gcc-patches/2004-01/msg00832.html by Richard. If I remove it, the testcase works, as well as this bigger one below. Wiping the initializers of the vector can't be right, so either that line can be just deleted, or we want to create zero vector and then initialize it field by field with the original values. typedef signed char v8qi __attribute__ ((vector_size (8))); extern "C" void abort (void); static unsigned char S[16]; struct A { int i; v8qi j, k; int l; }; void foo (unsigned char v) { A a = { 1, { v, v, v, v, v, v, v, v }, { v + 1, v + 1, v + 1, v + 1, v + 1, v + 1, v + 1, v + 1 }, 3 }; v8qi *s = (v8qi *) & S[0]; *s = a.j; s[1] = a.k; } void bar (unsigned char v) { v8qi val8 = { v, v, v, v, v, v, v, v }; v8qi *s = (v8qi *) & S[0]; *s = val8; } int main () { int i; foo (1); for (i = 0; i < 8; ++i) if (S[i] != 1) abort (); for (; i < 16; ++i) if (S[i] != 2) abort (); bar (3); for (i = 0; i < 8; ++i) if (S[i] != 3) abort (); return 0; } -- What |Removed |Added ---------------------------------------------------------------------------- CC| |rth at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19263