[cfe-commits] bools in vector_size attribute causes crash

Douglas Gregor dgregor at apple.com
Mon Apr 30 16:57:54 PDT 2012


On Apr 25, 2012, at 7:46 PM, Roland Leißa <leissa at cs.uni-saarland.de> wrote:

> my old patch seemed to have a problem. Now I'm doing the check differently.
> 
> Is the test case OK like this?

@@ -107,6 +109,7 @@ const int test17_n = 0;
 const char test17_c[] = {1, 2, 3, 0};
 const char test17_d[] = {1, 2, 3, 4};
 typedef int __attribute__((vector_size(16))) IntVector;
+typedef bool __attribute__((vector_size(16))) BoolVector; // expected-error 

How about just using _Bool here, so we don't have to #include <stdbool.h>?

	- Doug

> --
> Roland
> 
> ----- Original Message -----
>> From: "Chandler Carruth" <chandlerc at google.com>
>> To: "Roland Leißa" <leissa at cs.uni-saarland.de>
>> Cc: cfe-commits at cs.uiuc.edu
>> Sent: Mittwoch, 25. April 2012 19:03:09
>> Subject: Re: [cfe-commits] bools in vector_size attribute causes crash
>> 
>> 
>> 
>> On Tue, Apr 24, 2012 at 5:38 PM, Roland Leißa <
>> leissa at cs.uni-saarland.de > wrote:
>> 
>> 
>> Hi all,
>> 
>> this simple program currently causes a crash:
>> 
>> typedef bool bxmm __attribute__ ((vector_size(16)));
>> typedef float fxmm __attribute__ ((vector_size(16)));
>> 
>> bxmm f(fxmm a, fxmm b) {
>> return a < b;
>> }
>> 
>> 
>> The reason for this is, that actually bools are not allowed to be
>> declared as gcc-vectors. (At least gcc does not allow this).
>> The attached patch fixes this issue by emitting an error message when
>> using bools in gcc-vectors.
>> 
>> 
>> 
>> Test case as well please.
> <vector_size_bool_patch.diff>_______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list