www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Some bit array bit operations crash compiler

reply Derek Parnell <derek psych.ward> writes:
The following code crashes v0.127 

void main()
{
    bit [] X;
    bit [] Y;

    foreach( int i, bit yb; Y)
        X[i] ^= yb;  // Same with |=, &=, %=
}

The error message is ...

 Internal error: ..\ztc\cgcs.c 213

-- 
Derek
Melbourne, Australia
20/06/2005 10:30:05 AM
Jun 19 2005
next sibling parent reply zwang <nehzgnaw gmail.com> writes:
Derek Parnell wrote:
 The following code crashes v0.127 
 
 void main()
 {
     bit [] X;
     bit [] Y;
 
     foreach( int i, bit yb; Y)
         X[i] ^= yb;  // Same with |=, &=, %=
 }
 
 The error message is ...
 
  Internal error: ..\ztc\cgcs.c 213
 

The test case can be reduced to: <code> void main(){ bit[1] x; x[0]|=x[0]; } </code>
Jun 19 2005
parent reply Derek Parnell <derek psych.ward> writes:
On Mon, 20 Jun 2005 11:10:02 +0800, zwang wrote:

 Derek Parnell wrote:
 The following code crashes v0.127 
 
 void main()
 {
     bit [] X;
     bit [] Y;
 
     foreach( int i, bit yb; Y)
         X[i] ^= yb;  // Same with |=, &=, %=
 }
 
 The error message is ...
 
  Internal error: ..\ztc\cgcs.c 213
 

The test case can be reduced to: <code> void main(){ bit[1] x; x[0]|=x[0]; } </code>

Well done, but I can top that ;-) void main(){ bit[1] x; x[0]|=1; } -- Derek Melbourne, Australia 20/06/2005 1:23:06 PM
Jun 19 2005
parent reply zwang <nehzgnaw gmail.com> writes:
Derek Parnell wrote:
 On Mon, 20 Jun 2005 11:10:02 +0800, zwang wrote:
 
 
Derek Parnell wrote:

The following code crashes v0.127 

void main()
{
    bit [] X;
    bit [] Y;

    foreach( int i, bit yb; Y)
        X[i] ^= yb;  // Same with |=, &=, %=
}

The error message is ...

 Internal error: ..\ztc\cgcs.c 213

The test case can be reduced to: <code> void main(){ bit[1] x; x[0]|=x[0]; } </code>

Well done, but I can top that ;-) void main(){ bit[1] x; x[0]|=1; }

Interesting that the following code compiles. <code> void main(){ bit[1] x; x[0]|=0; } </code>
Jun 20 2005
parent Derek Parnell <derek psych.ward> writes:
On Mon, 20 Jun 2005 18:17:38 +0800, zwang wrote:

 Internal error: ..\ztc\cgcs.c 213




 void main(){
 bit[1] x;
 x[0]|=1;
 }


 Interesting that the following code compiles.
 <code>
 void main(){
 bit[1] x;
 x[0]|=0;
 }
 </code>

May be it is optimized out prior to code generation. -- Derek Parnell Melbourne, Australia 20/06/2005 9:19:24 PM
Jun 20 2005
prev sibling parent Thomas Kuehne <thomas-dloop kuehne.this-is-spam.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Derek Parnell schrieb am Mon, 20 Jun 2005 10:35:31 +1000:
 The following code crashes v0.127 

 void main()
 {
     bit [] X;
     bit [] Y;

     foreach( int i, bit yb; Y)
         X[i] ^= yb;  //Same with |=, &=, %=
 }

 The error message is ...

  Internal error: ..\ztc\cgcs.c 213

Added to DStress as http://dstress.kuehne.cn/run/o/opAndAssign_01_A.d http://dstress.kuehne.cn/run/o/opAndAssign_01_B.d http://dstress.kuehne.cn/run/o/opAndAssign_01_C.d http://dstress.kuehne.cn/run/o/opAndAssign_01_D.d http://dstress.kuehne.cn/run/o/opAndAssign_01_E.d http://dstress.kuehne.cn/run/o/opAndAssign_01_F.d http://dstress.kuehne.cn/run/o/opAndAssign_01_G.d http://dstress.kuehne.cn/run/o/opAndAssign_01_H.d http://dstress.kuehne.cn/run/o/opAndAssign_01_I.d http://dstress.kuehne.cn/run/o/opOrAssign_01_A.d http://dstress.kuehne.cn/run/o/opOrAssign_01_B.d http://dstress.kuehne.cn/run/o/opOrAssign_01_C.d http://dstress.kuehne.cn/run/o/opOrAssign_01_D.d http://dstress.kuehne.cn/run/o/opOrAssign_01_E.d http://dstress.kuehne.cn/run/o/opOrAssign_01_F.d http://dstress.kuehne.cn/run/o/opOrAssign_01_G.d http://dstress.kuehne.cn/run/o/opOrAssign_01_H.d http://dstress.kuehne.cn/run/o/opOrAssign_01_I.d http://dstress.kuehne.cn/run/o/opXorAssign_01_A.d http://dstress.kuehne.cn/run/o/opXorAssign_01_B.d http://dstress.kuehne.cn/run/o/opXorAssign_01_C.d http://dstress.kuehne.cn/run/o/opXorAssign_01_D.d http://dstress.kuehne.cn/run/o/opXorAssign_01_E.d http://dstress.kuehne.cn/run/o/opXorAssign_01_F.d http://dstress.kuehne.cn/run/o/opXorAssign_01_G.d http://dstress.kuehne.cn/run/o/opXorAssign_01_H.d http://dstress.kuehne.cn/run/o/opXorAssign_01_I.d http://dstress.kuehne.cn/run/o/opXorAssign_01_J.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCuT+23w+/yD4P9tIRApG/AKC05DIjGi3YMj0IC6y6cLcVGxy5MQCgwYfu lppm/xV5jzhQhUTXjUi5L+8= =hMEI -----END PGP SIGNATURE-----
Jun 22 2005