Linux/PPC gcc 2.95.2 - bad access generated when using inline func

Cort Dougan cort@fsmlabs.com
Wed Jun 28 11:46:00 GMT 2000


Franz just sent me a note to the effect that he had found the problem.
You may want to check with him to see what he's found.  I'm not certain
that r8 has the wrong value, in fact, I think it has the correct value.  I
believe the error occurs before the lwarx.

The exact command line flags were in the first mail.  I'll include that part:

GCC command line and files
---
gcc -I/sys/linux/include -I/sys/rtlinux/include -I/sys/rtlinux/include/compat  -I/sys/rtlinux/include/posix -Wall -Wstrict-prototypes -O2 -g -D__RTL__ -D__KERNEL__ -DMODULE -D__powerpc__ -fsigned-char -msoft-float -pipe -fno-builtin -ffixed -r2 -Wno-uninitialized -mmultiple -mstring -DMODVERSIONS -include /sys/linux/include/linux/modversions.h  -D__powerpc__  -c rtl_core.c -o rtl_core.o

} I get the following code for rtl_soft_cli with -O2 and gcc 2.95.2:
} 
} rtl_soft_cli:
}         lis 10,rtl_local@ha
}         lwz 0,rtl_local@l(10)
}         la 8,rtl_local@l(10)
}         andi. 9,0,2
}         bc 12,2,.L1240
}         lwz 9,-16(1)
}         lis 11,last_cli@ha
}         lwz 0,4(9)
}         stw 0,last_cli@l(11)
} .L1240:
}         li 0,2
}         1:      lwarx   9,0,8
}         andc    9,9,0
}         stwcx.  9,0,8
}         bne     1b
}         blr
} 
} I don't see that register 8 has the wrong value.  It looks like it
} contains the address of the global variable rtl_local.  Could you be
} more specific about what compiler flags you used, what assembler
} output you got, and what is wong with it?
} 
} -- 
} - Geoffrey Keating <geoffk@cygnus.com>


More information about the Gcc-bugs mailing list