Thread overview | ||||||||
---|---|---|---|---|---|---|---|---|
|
June 20, 2005 Some bit array bit operations crash compiler | ||||
---|---|---|---|---|
| ||||
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
|
June 20, 2005 Re: Some bit array bit operations crash compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to Derek Parnell | 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>
|
June 20, 2005 Re: Some bit array bit operations crash compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to zwang | 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 |
June 20, 2005 Re: Some bit array bit operations crash compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to Derek Parnell | 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>
|
June 20, 2005 Re: Some bit array bit operations crash compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to zwang | 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 |
Copyright © 1999-2021 by the D Language Foundation