This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc bug?
Dear Martin and bug-gcc list:
The problem I was reporting yesterday was
from gcc 2.7.2.2. The newer version, 2.95.2,
does not display the problem. Thus I am
considering this bug moot. Thank you anyway
for your support.
--Randy Yates
************copy of earlier message*****************
Hi,
I'm using the gcc compiler,
[qusraya@edgedsp1] ~ $ gcc -v
Reading specs from /apps/gnu/solaris2.7/lib/gcc-lib/sparc-sun-solaris2.7/2.7.2.2/specs
gcc version 2.7.2.2
under the Sun OS,
[qusraya@edgedsp1] ~ $ uname -a
SunOS edgedsp1 5.7 Generic sun4u sparc SUNW,Ultra-5_10
I have noticed that my structures are not packed as tightly
as they could be. When I try to tighten them up by specifying
fpack-struct, I get the following messages:
[qusraya@edgedsp1] /vobs/edgedsp_sw/src/EDGE/hostif $ gcc -c -Wall -fpack-struct -I. -I../../include hostif.c
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 8: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 10: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 12: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 14: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 16: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 18: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 20: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 22: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 24: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 26: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 28: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 30: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 32: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 34: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 36: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 38: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 40: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 42: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 44: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 46: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 48: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 50: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 52: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 54: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 56: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 58: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 60: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 62: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 64: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 66: error: location counter not on word boundary
/usr/ccs/bin/as: "/home/unix/qusraya/tmp/cc4oa4Pq.s", line 72: error: location counter not on word boundary
This appears to be a bug, or rather is it that I'm doing something wrong? I also
tried using the __attribute__((packed)) but it made no difference on the size
of the structure. Here's the structure:
typedef struct {
UINT16_T application_address_high; /* DSP application address (high word) */
UINT16_T application_address_low; /* DSP application address (low word) */
unsigned reserved : 15; /* DSP ready */
unsigned dr : 1;
unsigned reservedb: 15; /* DSP PLL clock mode */
unsigned pcm : 1;
UINT16_T dsp_version; /* DSP version */
UINT16_T low_softbit_cache_threshold; /* low softbit cache threshold */
UINT16_T adequate_softbit_cache_threshold; /* adequate softbit cache threshold */
} INITIALIZATION_TABLE_T __attribute__((packed));
This structure can be packed to 7 16-bit words but instead the compiler always
generates it in 8 16-bit words. The special type UINT16_T:
typedef unsigned short UINT16_T;
is defined is dsptypes.h.
I have attached hostif.c, hostif.h, and dsptypes.h in order to help
you reproduce this error.
Any help, pointers, acknowledgements of guilt, etc. would be appreciated.
--
Randy Yates
DSP Engineer
Ericsson / Research Triangle Park, NC, USA
qusraya@rtp.ericsson.se, 919-472-1124