[cfe-dev] more infos on test CodeGen/array.c failure

Steve Naroff snaroff at apple.com
Wed Oct 31 08:58:57 PDT 2007


On Oct 31, 2007, at 12:30 AM, Giangiacomo Mariotti wrote:

> On my Debian x86_64 the test CodeGen/array.c fails with a  
> segmentation fault. I've modified function f2() of test array.c to  
> try to find exactly when it fails,these are my results :
> Array initialization with at least one variable never fails. (ex.  
> int c2[5] = {y, 1, 2, 3, 4};)
> Array initialization with just immediate values sometimes fails,it  
> depends on the array type(int and double fails,all the other types  
> don't).
> (the lines commented are those that fail)
> int f2() {
>   int x = 0;
>   int y = 1;
>   int a[10] = { y, x, 2, 3};
>   int b[10] = { 2,4,x,6,y,8};
>   //int c0[5] = {0, 1, 2, 3, 4}; --> fails
>   //int c1[5] = { 0,1,2,3}; -->fails
>   int c2[5] = {y, 1, 2, 3, 4};
>   int c3[5] = {0, y, 2, 3, 4};
>   int c4[5] = {0, 1, y, 3, 4};
>   int c5[5] = {0, 1, 2, y, 4};
>   int c6[5] = {0, 1, 2, 3, y};
>   int c7[5] = {x, x, x, x, x};
>   int c8[5] = { x,1,2,3};
>   int c9[5] = { 0,x,2,3};
>   int c10[5] = { 0,1,x,3};
>   int c11[5] = { 0,1,2,x};
>   long long c12[5] = {0, 1, 2, 3, 4};
>   long long c13[5] = {0, 1, 2, 3};
>   long long z = 400;
>   long long c14[5] = {z, 1, 2, 3};
>   long long c15[5] = {0, z, 2, 3};
>   long long c16[5] = {0, 1, z, 3};
>   long long c17[5] = {0, 1, 2, z};
>   long long c18[5] = {z, z, z, z};
>   long long c19[5] = {z, 1, 2, 3, 4};
>   long long c20[5] = {0, z, 2, 3, 4};
>   long long c21[5] = {0, 1, z, 3, 4};
>   long long c22[5] = {0, 1, 2, z, 4};
>   long long c23[5] = {0, 1, 2, 3, z};
>   char c24[5] = {0, 1, 2, 3, 4};
>   char c25[5] = {0, 1, 2, 3};
>   short c26[5] = {0, 1, 2, 3, 4};
>   short c27[5] = {0, 1, 2, 3};
>   //unsigned int c28[5] = {0, 1, 2, 3, 4}; -->fails
>   //unsigned int c29[5] = {0, 1, 2, 3}; -->fails
>   float c30[5] = {0.1, 1.1, 2.1, 3.1, 4.1};
>   float c31[5] = {0.2, 1.2, 2.2, 3.2};
>   //double c32[5] = {0.1, 1.1, 2.1, 3.1, 4.1}; -->fails
>   //double c33[5] = {0.2, 1.2, 2.2, 3.2}; -->fails
> }
>

Pretty strange. I will try and look into this within the next week  
(I'm currently focused on some other stuff).

Thanks for the test case.

> I couldn't test arrays of structs because of strange behaviour,maye  
> not implemented yet?
>

Yes...it isn't implemented yet (fyi...there is a FIXME in the code).

snaroff

> P.S. I've noticed that for variables of type "long" clang produces  
> 32bit code(and array initialization fails like for normal ints),but  
> on x86_64 shouldn't it produce 64bit code?
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list