This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[patch] Re: What happens with __attribute__((vector_size(8))) short a = {1, -1};?
>>>>> "Andrew" == Andrew Pinski <pinskia@physics.uc.edu> writes:
> It has been filed under pr 11243.
[Patch below]
Sweet! Andrew, thanks so much for keeping up with the bug database.
Could you please close it shortly (when this is approved), cuz I just
came up with a patch ;-).
This fixes the aforementioned problem. Elements not explicitly
initialized should be initialized to 0.
I suppose we could tweak the tree directly upon creation, but this is
easier.
OK?
2003-06-19 Aldy Hernandez <aldyh@redhat.com>
* expr.c (const_vector_from_tree): Initialize remaining elements
to 0.
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.552
diff -c -p -r1.552 expr.c
*** expr.c 16 Jun 2003 21:41:02 -0000 1.552
--- expr.c 19 Jun 2003 14:19:47 -0000
*************** const_vector_from_tree (exp)
*** 10523,10528 ****
--- 10523,10532 ----
inner);
}
+ /* Initialize remaining elements to 0. */
+ for (; i < units; ++i)
+ RTVEC_ELT (v, i) = CONST0_RTX (inner);
+
return gen_rtx_raw_CONST_VECTOR (mode, v);
}