#1473 closed defect
mips 64bit issues?
Reported by: | Ralf Corsepius | Owned by: | Joel Sherrill |
---|---|---|---|
Priority: | normal | Milestone: | 4.10 |
Component: | score | Version: | 4.10 |
Severity: | normal | Keywords: | |
Cc: | Blocked By: | ||
Blocking: |
Description (last modified by Joel Sherrill)
When building mips/hurricane, I am observing this warning:
# mips-rtems4.10-gcc --pipe -DHAVE_CONFIG_H -I.. -I../../cpukit/../../../hurricane/lib/include -DRTEMS_INSIDE -mips3 -G0 -EL -O2 -g -fomit-frame-pointer -Wall -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs -MT src/libscore_a-threadloadenv.o -MD -MP -MF src/.deps/libscore_a-threadloadenv.Tpo -c -o src/libscore_a-threadloadenv.o test -f 'src/threadloadenv.c' || echo '../../../../../../c/src/../../cpukit/score/'
src/threadloadenv.c
../../../../../../c/src/../../cpukit/score/src/threadloadenv.c: In function '_Thread_Load_environment':
../../../../../../c/src/../../cpukit/score/src/threadloadenv.c:67: warning: cast from pointer to integer of different size
This warning refers to this line
(&the_thread->Registers)->ra = (uint64_t)_Thread_Handler;
from _CPU_Context_Initialize
(The uint64_t to be seen above is MIPS_REGISTER_TYPE)
I read this as hint of this BSP assuming to be using 64bit, while the compiler actually uses 32bit. Unfortunately, I am not sufficiently familiar with the mips to be able to further comment on this issue.
Change History (2)
comment:1 Changed on 11/16/09 at 17:16:00 by Joel Sherrill
comment:2 Changed on 11/21/14 at 15:44:23 by Joel Sherrill
Description: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | new → closed |
There are no warnings building this code now.
I vaguely recalled that it has 64-bit registers but by default everything is 64 bits. You can add -mlong64 and it will use long as 64 bits. The void * is definitely 32 bits and the left hand side is definitely "register sized" and 64 bits. AFAIK regs are >= size of ptrs on all mips. So how can be we make this close cleaner.
$ cat m1.c
int size_ptr = sizeof(void *);
int size_int = sizeof(int);
$ mips-rtems4.10-gcc -mips3 -EL -S m1.c && cat m1.s
size_ptr:
size_int: