Reply by January 29, 20042004-01-29

Jerry, there is not context. I just compile a module with this code. And the compile does not report arrors nor warnings (it might be a runtime error). It simply crashes and windows closes the gui. It happens in codewarrior 5.0.5 with W2000. I have not tested in other environments.

Note. I am using other account, because I cannot use the same until monday.

Thanks to you and John.

Santi.

----- Mensaje Original -----
Remitente: "Johnson, Jerry" j...@giddings.com
Destinatario: 'Winters John-r54531' J...@motorola.com, 'Santi Corera' s...@telefonica.net, m...@yahoogroups.com
Fecha: Jueves, Enero 29, 2004 7:28pm
Asunto: RE: [motoroladsp] Codewarrior 5.0.5 bug ?

 
 
The difference might be in the context!!!  Nested do loops can create an overflow of the hardware loop stack during interrupt operations.  Allowing do loops may create other loops in interrupt code.
 
Jerry.
-----Original Message-----
From: Winters John-r54531 [mailto:J...@motorola.com]
Sent: Thursday, January 29, 2004 11:02 AM
To: 'Santi Corera'; m...@yahoogroups.com
Subject: RE: [motoroladsp] Codewarrior 5.0.5 bug ?

I just used CW 6.0 and it handled it very well.  Here is the generated .asm file:
 
 
include "asmdef.h"
 
 SECTION allowdo ; declarations
  global Fmain
 ENDSEC
 
 SECTION allowdo ; declarations
  xref ARTMAIN
 ENDSEC
 
 SECTION allowdo ; declarations
  global Fptr1
  global Ft
 ENDSEC
 
 SECTION allowdo
 
 ORG P:
 
;
;   37:  
;   38: void main(short param){
;   39:    short i;
;   40:    short *ptr;
;   41:    if(param == 0){
;
  subroutine "Fmain",Fmain,end_Fmain-Fmain
Fmain:
              tst.w       Y0
              bne         <_L6_0 ; *+11
;
;   42:       for(i=0, ptr=ptr1; i<8; i++)
;
              move.w      #<0,B
              moveu.w     X:>Fptr1,R0
;
;   43:           *ptr++ = i+1;
;   44:    }
;   45:    else{
;
              do          #<8,>_L6_1
              move.w      B1,A
              add.w       #<1,A
              move.w      A1,X:(R0)+
              add.w       #<1,B
_L6_1:
              bra         <_L6_2 ; *+3
;
;   46:       t = 0;
;   47:    }
;
_L6_0:
              move.w      #<0,X:>Ft
;
;   48: }
;
_L6_2:
              rts        
end_Fmain:
 
 ENDSEC
 
 SECTION allowdo
 
 ORG X:
 

;   *** UNINITIALIZED DATA (.bss) ***
 
   align 2
  Fptr1: ds 1
 
 ENDSEC
 
 SECTION allowdo
 
 ORG X:
 

;   *** UNINITIALIZED DATA (.bss) ***
 
   align 2
  Ft: ds 1
 
 ENDSEC
 

 END
 
 

-----------------------------------
John L. Winters
Sr. Application Engineer
DSP Operation 8/16 Bit Products Division
Transportation & Standard Products Group Motorola Inc.
-----------------------------------
* For faster turnaround in answering support questions please access *
* Motorola's Customer Support web site at *
* http://www.motorola.com/semiconductors/support *
* *
* Or send email to: D...@motorola.com *
-----------------------------------

Motorola General Business Information

 

-----Original Message-----
From: Santi Corera [mailto:s...@telefonica.net]
Sent: Thursday, January 29, 2004 9:40 AM
To: m...@yahoogroups.com
Subject: [motoroladsp] Codewarrior 5.0.5 bug ?

// please, look this simple code, I have extracted and simplified it from a large proyect:

short t;
short *ptr1;  
void Init(short ta);
 
void Init(short param){
   short i;
   short *ptr;
   if(param == 0){
      for(i=0, ptr=ptr1; i<8; i++)
          *ptr++ = i+1;
   }
   else{
      t = 0;
   }
}
 
// if you compile it with some optimization level (say Level 1, for speed) and
// mark "allow DO instructions" in settings->M56800 Processor, Codewarrior
// crashes.
// The only way to compile it is without optimization or not allowing DO
// instructions.
// I am working with version 5.0.5
// Can somebody tell me if this bug is corrected in a posterior version of codewarrior ?
// Thanks.
 
 


_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer.  You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:  m...@yahoogroups.com

To Post:  m...@yahoogroups.com

To Leave: m...@yahoogroups.com

Archives: http://www.yahoogroups.com/group/motoroladsp

More Groups: http://www.dsprelated.com/groups.php3
Yahoo! Groups Links
To


_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer.  You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:  m...@yahoogroups.com

To Post:  m...@yahoogroups.com

To Leave: m...@yahoogroups.com

Archives: http://www.yahoogroups.com/group/motoroladsp

More Groups: http://www.dsprelated.com/groups.php3
Yahoo! Groups Links
To

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information visit http://www.messagelabs.com
________________________________________________________________________

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information visit http://www.messagelabs.com
_____________________________________________________________________________________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer.  You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:  m...@yahoogroups.com

To Post:  m...@yahoogroups.com

To Leave: m...@yahoogroups.com

Archives: http://www.yahoogroups.com/group/motoroladsp

More Groups: http://www.dsprelated.com/groups.php3
Yahoo! Groups Links
To
Reply by Johnson, Jerry January 29, 20042004-01-29
Message
The difference might be in the context!!!  Nested do loops can create an overflow of the hardware loop stack during interrupt operations.  Allowing do loops may create other loops in interrupt code.
 
Jerry.
-----Original Message-----
From: Winters John-r54531 [mailto:J...@motorola.com]
Sent: Thursday, January 29, 2004 11:02 AM
To: 'Santi Corera'; m...@yahoogroups.com
Subject: RE: [motoroladsp] Codewarrior 5.0.5 bug ?

I just used CW 6.0 and it handled it very well.  Here is the generated .asm file:
 
 
include "asmdef.h"
 
 SECTION allowdo ; declarations
  global Fmain
 ENDSEC
 
 SECTION allowdo ; declarations
  xref ARTMAIN
 ENDSEC
 
 SECTION allowdo ; declarations
  global Fptr1
  global Ft
 ENDSEC
 
 SECTION allowdo
 
 ORG P:
 
;
;   37:  
;   38: void main(short param){
;   39:    short i;
;   40:    short *ptr;
;   41:    if(param == 0){
;
  subroutine "Fmain",Fmain,end_Fmain-Fmain
Fmain:
              tst.w       Y0
              bne         <_L6_0 ; *+11
;
;   42:       for(i=0, ptr=ptr1; i<8; i++)
;
              move.w      #<0,B
              moveu.w     X:>Fptr1,R0
;
;   43:           *ptr++ = i+1;
;   44:    }
;   45:    else{
;
              do          #<8,>_L6_1
              move.w      B1,A
              add.w       #<1,A
              move.w      A1,X:(R0)+
              add.w       #<1,B
_L6_1:
              bra         <_L6_2 ; *+3
;
;   46:       t = 0;
;   47:    }
;
_L6_0:
              move.w      #<0,X:>Ft
;
;   48: }
;
_L6_2:
              rts        
end_Fmain:
 
 ENDSEC
 
 SECTION allowdo
 
 ORG X:
 

;   *** UNINITIALIZED DATA (.bss) ***
 
   align 2
  Fptr1: ds 1
 
 ENDSEC
 
 SECTION allowdo
 
 ORG X:
 

;   *** UNINITIALIZED DATA (.bss) ***
 
   align 2
  Ft: ds 1
 
 ENDSEC
 

 END
 
 

-----------------------------------
John L. Winters
Sr. Application Engineer
DSP Operation 8/16 Bit Products Division
Transportation & Standard Products Group Motorola Inc.
-----------------------------------
* For faster turnaround in answering support questions please access *
* Motorola's Customer Support web site at *
* http://www.motorola.com/semiconductors/support *
* *
* Or send email to: D...@motorola.com *
-----------------------------------

Motorola General Business Information

 

-----Original Message-----
From: Santi Corera [mailto:s...@telefonica.net]
Sent: Thursday, January 29, 2004 9:40 AM
To: m...@yahoogroups.com
Subject: [motoroladsp] Codewarrior 5.0.5 bug ?

// please, look this simple code, I have extracted and simplified it from a large proyect:

short t;
short *ptr1;  
void Init(short ta);
 
void Init(short param){
   short i;
   short *ptr;
   if(param == 0){
      for(i=0, ptr=ptr1; i<8; i++)
          *ptr++ = i+1;
   }
   else{
      t = 0;
   }
}
 
// if you compile it with some optimization level (say Level 1, for speed) and
// mark "allow DO instructions" in settings->M56800 Processor, Codewarrior
// crashes.
// The only way to compile it is without optimization or not allowing DO
// instructions.
// I am working with version 5.0.5
// Can somebody tell me if this bug is corrected in a posterior version of codewarrior ?
// Thanks.
 
 


_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer.  You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:  m...@yahoogroups.com

To Post:  m...@yahoogroups.com

To Leave: m...@yahoogroups.com

Archives: http://www.yahoogroups.com/group/motoroladsp

More Groups: http://www.dsprelated.com/groups.php3
Yahoo! Groups Links
To


_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer.  You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:  m...@yahoogroups.com

To Post:  m...@yahoogroups.com

To Leave: m...@yahoogroups.com

Archives: http://www.yahoogroups.com/group/motoroladsp

More Groups: http://www.dsprelated.com/groups.php3
Yahoo! Groups Links
To

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information visit http://www.messagelabs.com
________________________________________________________________________

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information visit http://www.messagelabs.com
________________________________________________________________________
Reply by Winters John-r54531 January 29, 20042004-01-29
Message
I just used CW 6.0 and it handled it very well.  Here is the generated .asm file:
 
 
include "asmdef.h"
 
 SECTION allowdo ; declarations
  global Fmain
 ENDSEC
 
 SECTION allowdo ; declarations
  xref ARTMAIN
 ENDSEC
 
 SECTION allowdo ; declarations
  global Fptr1
  global Ft
 ENDSEC
 
 SECTION allowdo
 
 ORG P:
 
;
;   37:  
;   38: void main(short param){
;   39:    short i;
;   40:    short *ptr;
;   41:    if(param == 0){
;
  subroutine "Fmain",Fmain,end_Fmain-Fmain
Fmain:
              tst.w       Y0
              bne         <_L6_0 ; *+11
;
;   42:       for(i=0, ptr=ptr1; i<8; i++)
;
              move.w      #<0,B
              moveu.w     X:>Fptr1,R0
;
;   43:           *ptr++ = i+1;
;   44:    }
;   45:    else{
;
              do          #<8,>_L6_1
              move.w      B1,A
              add.w       #<1,A
              move.w      A1,X:(R0)+
              add.w       #<1,B
_L6_1:
              bra         <_L6_2 ; *+3
;
;   46:       t = 0;
;   47:    }
;
_L6_0:
              move.w      #<0,X:>Ft
;
;   48: }
;
_L6_2:
              rts        
end_Fmain:
 
 ENDSEC
 
 SECTION allowdo
 
 ORG X:
 

;   *** UNINITIALIZED DATA (.bss) ***
 
   align 2
  Fptr1: ds 1
 
 ENDSEC
 
 SECTION allowdo
 
 ORG X:
 

;   *** UNINITIALIZED DATA (.bss) ***
 
   align 2
  Ft: ds 1
 
 ENDSEC
 

 END
 
 

-----------------------------------
John L. Winters
Sr. Application Engineer
DSP Operation 8/16 Bit Products Division
Transportation & Standard Products Group Motorola Inc.
-----------------------------------
* For faster turnaround in answering support questions please access *
* Motorola's Customer Support web site at *
* http://www.motorola.com/semiconductors/support *
* *
* Or send email to: D...@motorola.com *
-----------------------------------

Motorola General Business Information

 

-----Original Message-----
From: Santi Corera [mailto:s...@telefonica.net]
Sent: Thursday, January 29, 2004 9:40 AM
To: m...@yahoogroups.com
Subject: [motoroladsp] Codewarrior 5.0.5 bug ?

// please, look this simple code, I have extracted and simplified it from a large proyect:

short t;
short *ptr1;  
void Init(short ta);
 
void Init(short param){
   short i;
   short *ptr;
   if(param == 0){
      for(i=0, ptr=ptr1; i<8; i++)
          *ptr++ = i+1;
   }
   else{
      t = 0;
   }
}
 
// if you compile it with some optimization level (say Level 1, for speed) and
// mark "allow DO instructions" in settings->M56800 Processor, Codewarrior
// crashes.
// The only way to compile it is without optimization or not allowing DO
// instructions.
// I am working with version 5.0.5
// Can somebody tell me if this bug is corrected in a posterior version of codewarrior ?
// Thanks.
 
 


_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer.  You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:  m...@yahoogroups.com

To Post:  m...@yahoogroups.com

To Leave: m...@yahoogroups.com

Archives: http://www.yahoogroups.com/group/motoroladsp

More Groups: http://www.dsprelated.com/groups.php3
Yahoo! Groups Links
To


Reply by Santi Corera January 29, 20042004-01-29
// please, look this simple code, I have extracted and simplified it from a large proyect:

short t;
short *ptr1;  
void Init(short ta);
 
void Init(short param){
   short i;
   short *ptr;
   if(param == 0){
      for(i=0, ptr=ptr1; i<8; i++)
          *ptr++ = i+1;
   }
   else{
      t = 0;
   }
}
 
// if you compile it with some optimization level (say Level 1, for speed) and
// mark "allow DO instructions" in settings->M56800 Processor, Codewarrior
// crashes.
// The only way to compile it is without optimization or not allowing DO
// instructions.
// I am working with version 5.0.5
// Can somebody tell me if this bug is corrected in a posterior version of codewarrior ?
// Thanks.