This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Re: What happens with __attribute__((vector_size(8))) short a = {1, -1};?
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: Kazu Hirata <kazu at cs dot umass dot edu>, gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: 19 Jun 2003 10:23:21 -0400
- Subject: [patch] Re: What happens with __attribute__((vector_size(8))) short a = {1, -1};?
- References: <m3llvyma98.fsf@frogsleap.quesejoda.com><F75CA570-A25F-11D7-922B-000393A6D2F2@physics.uc.edu>
>>>>> "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);
}