This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
m68k-coff sp decrements on assignments
- To: Nick Clifton <nickc at redhat dot com>, Alan Modra <alan at linuxcare dot com dot au>
- Subject: m68k-coff sp decrements on assignments
- From: Nick Papadonis <npapadon at yahoo dot com>
- Date: 30 Mar 2001 01:43:14 -0500
- Cc: gcc at gcc dot gnu dot org
- Organization: None
I don't know if this was related to the bug with m68k-coff symbols.
This is some compiled C code and my stack pointer keeps getting
decremented on assignments. I don't have any trouble with code before
these assignments. I use gcc 2.95.3 and don't know how gcc is built
on top of binutils. Have any of you seen
anything like:
lcd_init () at sys/hw332.c:217
217 {
2: /x $sp = 0x7ac
1: x/i $pc 0x502c <lcd_init>: subqw #8,%sp
(gdb)
0x502e 217 {
2: /x $sp = 0x7a4
1: x/i $pc 0x502e <lcd_init+2>: movel %fp,%sp@-
(gdb)
221 LCD_MR0 = 0x18;
2: /x $sp = 0x7a0
1: x/i $pc 0x5030 <lcd_init+4>: moveb #24,0x41ffe1
(gdb)
223 LCD_MR1 = 0xb0;
2: /x $sp = 0x79c
1: x/i $pc 0x5038 <lcd_init+12>: moveb #-80,0x41ffe2
(gdb)
226 LCD_HPS = 0x27; /* 320 / 8 - 1 in hex */
2: /x $sp = 0x798
1: x/i $pc 0x5040 <lcd_init+20>: moveb #39,0x41ffe4
(gdb)
227 LCD_VPS_L = 0xef; /* LSB of 240 -1 */
2: /x $sp = 0x794
1: x/i $pc 0x5048 <lcd_init+28>: moveb #-17,0x41ffe5
(gdb)
The code snipits from this section are:
#define LCD_MR0 *(volatile unsigned char *)(LCD_BASE + 0x1ffe1)
#define LCD_MR1 *(volatile unsigned char *)(LCD_BASE + 0x1ffe2)
#define LCD_MR2 *(volatile unsigned char *)(LCD_BASE + 0x1ffe3)
#define LCD_HPS *(volatile unsigned char *)(LCD_BASE +
0x1ffe4)
static void lcd_init (void) {
short i;
LCD_MR0 = 0x18;
LCD_MR1 = 0xb0;
LCD_HPS = 0x27; /* 320 / 8 - 1 in hex */
LCD_VPS_L = 0xef; /* LSB of 240 -1 */
Any insight much appreciated.
--
- Nick