forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

IBSET giving error

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Plato
View previous topic :: View next topic  
Author Message
MarzAttax



Joined: 15 Jun 2006
Posts: 46

PostPosted: Thu Jun 15, 2006 9:41 am    Post subject: IBSET giving error Reply with quote

If Debug/Checking is off and I try to comile the code below, I get the error:
"error 137 - Operand incompatible with opcode"

If I use Integer*4 only, the error goes away.

Interestingly, if the line

! iDataL = i1DataL

is uncommented, the error goes away too - lol

Does IBSET only work for Integer*4?

Could someone help me with this - thanx.


!=======================================================================
!
PROGRAM Function BSET_MARE

!! Passed
Integer*2 i2BeforeP, i2AfterP
Integer*4 i4ArrayPosP

!! Locals
Integer*1 i1DataL
Integer*4 iDataL

Integer*1, ALLOCATABLE :: i1BitArrayG(Smile
!
!=======================================================================
!
i2BeforeP = 0
i2AfterP = 1
i4ArrayPosP = 12

i1DataL = i1BitArrayG(i4ArrayPosP)
! iDataL = i1DataL

If(i2BeforeP.EQ.1) Then
iDataL = IBSET(iDataL, 0)
i1DataL = IBSET(i1DataL, 0)
Endif
If(i2AfterP.EQ.1) Then
iDataL = IBSET(iDataL, 1)
Endif
i1DataL = iDataL

i1BitArrayG(i4ArrayPosP) = i1DataL

End
!
!=======================================================================
Back to top
View user's profile Send private message
brucebowler
Guest





PostPosted: Thu Jun 15, 2006 12:38 pm    Post subject: IBSET giving error Reply with quote

Assuming that's a complete program, you don't allocate any space for i1BitArrayG. Since it's not allocated, it's not (to me) too surprising that things don't work quite as you expect. I *am* a bit surprised about the text of the error, I would have expected a different description of what went wrong...
Back to top
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7924
Location: Salford, UK

PostPosted: Fri Jun 16, 2006 2:42 am    Post subject: IBSET giving error Reply with quote

Brian

You must have modified code before posting it here.
The posted code contains syntax errors as well as variables not allocated and not initialised.
I have done a simple test on IBIT using an INTEGER*1 and my test worked OK.

The error message you quoted indicates a compiler bug or at least a programming error with a poor diagnostic but you will need to post the actual code that gave the error.
Back to top
View user's profile Send private message AIM Address
Anonymous
Guest





PostPosted: Fri Jun 16, 2006 5:38 am    Post subject: IBSET giving error Reply with quote

I do not care about whether the variables are ALLOCATED and/or initialised

I am pointing out that I cannot "COMPILE" it, I do not CARE if it runs or not as the code is "MADE UP"

And NO I did not modify the code before I posted it.
Are you assuming that the code actually does something useful and runs.
Again, I am trying to show that the code does NOT compile under certain circumstances.

Could you tell me what the syntax errors are then, coz all I get is the compiler error I gave.



Bri
Back to top
brucebowler
Guest





PostPosted: Fri Jun 16, 2006 6:54 am    Post subject: IBSET giving error Reply with quote

Syntax error #1 "Program function bset_mare" should be "program bset_mare".

Here's a much simpler (5 lines) program that also demonstrates the problem.

integer*1 a
integer*1 b
a = b
a = IBSET(a, 0)
end

Note that if you change the line a=b to a=1, the program does compile
Back to top
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7924
Location: Salford, UK

PostPosted: Fri Jun 16, 2006 8:33 am    Post subject: IBSET giving error Reply with quote

Yes there is a compiler bug here.

The code optimiser is failing on the statement

a = IBSET(a,0)

The following is sufficient to inhibit the optimiser in this context

a = IBSET(a+0,0)

but there will be lots of ways of avoiding the problem.






Back to top
View user's profile Send private message AIM Address
Anonymous
Guest





PostPosted: Fri Jun 16, 2006 9:34 am    Post subject: IBSET giving error Reply with quote

Ok, I admit that was wrong.

However there is no Syntax error from my compiler v4.8

Yes I know a newer one is available Surprised)

Thanx for the demo
Back to top
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Plato All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group