#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:

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 Nov 16, 2009 at 5:16:00 PM by Joel Sherrill

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

.file 1 "m1.c"
.section .mdebug.abi32
.gnu_attribute 4, 1
.globl size_ptr
.align 2
.type size_ptr, @object
.size size_ptr, 4


.word 4
.globl size_int
.align 2
.type size_int, @object
.size size_int, 4


.word 4
.ident "GCC: (GNU) 4.4.2"

comment:2 Changed on Nov 21, 2014 at 3:44:23 PM by Joel Sherrill

Description: modified (diff)
Resolution: fixed
Status: newclosed

There are no warnings building this code now.

Note: See TracTickets for help on using tickets.