Skip to contentSkip to conversation

gcc-3.[02] alignment problem

parisc-linux Randolph Chung 4 participants 9 messages Jul 16, 2002

lore
Share & tools
lore
#0 lore raw

Compiling the linux kernel (2.4.19-rc1-ac5) with hppa64-linux-gcc (3.0.4 or 3.2) gives:

tausq@a500:~/src/linux-2.4.19-rc1/net/ipv4$ hppa64-linux-gcc -D__KERNEL__ -I/home/tausq/src/linux-2.4.19-rc1/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -D__linux__ -pipe -fno-strength-reduce -mno-space-regs -mfast-indirect-calls -mdisable-fpregs -ffunction-sections -march=2.0 -mschedule=8000   -nostdinc -I /usr/lib/gcc-lib/hppa64-linux/3.0/include -DKBUILD_BASENAME=tcp_diag  -c -o tcp_diag.o tcp_diag.c
{standard input}: Assembler messages:
{standard input}:138: Error: Field not properly aligned [8] (44).
{standard input}:138: Error: Invalid operands
{standard input}:609: Error: Field not properly aligned [8] (44).
{standard input}:609: Error: Invalid operands
{standard input}:707: Error: Field not properly aligned [8] (44).
{standard input}:707: Error: Invalid operands

preprocessed source attached.

(incidentally, we also see this while building glibc...)

randolph

Signature · 3 lines
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/
#1 lore raw
Quoted 1 line

preprocessed source attached.

really attached this time <sigh>

randolph

Signature · 3 lines
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/
#2 lore raw
In reply to Randolph Chung
Quoted 1 line

preprocessed source attached.

really attached this time <sigh>

randolph

Signature · 3 lines
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/
#3 lore raw
In reply to Randolph Chung
Quoted 7 lines · Randolph Chung

Compiling the linux kernel (2.4.19-rc1-ac5) with hppa64-linux-gcc (3.0.4 or 3.2) gives:

tausq@a500:~/src/linux-2.4.19-rc1/net/ipv4$ hppa64-linux-gcc -D__KERNEL__ -I/home/tausq/src/linux-2.4.19-rc1/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -D__linux__ -pipe -fno-strength-reduce -mno-space-regs -mfast-indirect-calls -mdisable-fpregs -ffunction-sections -march=2.0 -mschedule=8000   -nostdinc -I /usr/lib/gcc-lib/hppa64-linux/3.0/include -DKBUILD_BASENAME=tcp_diag  -c -o tcp_diag.o tcp_diag.c
{standard input}: Assembler messages:
{standard input}:138: Error: Field not properly aligned [8] (44).
{standard input}:138: Error: Invalid operands

The pa-risc tree has a disgusting hack to work around this. Its one of the bits I have down in the "vomit grade" pile of bits to look into during the rest of the merge.

#4 lore raw
In reply to Randolph Chung
Quoted 7 lines · Randolph Chung

Compiling the linux kernel (2.4.19-rc1-ac5) with hppa64-linux-gcc (3.0.4 or 3.2) gives:

tausq@a500:~/src/linux-2.4.19-rc1/net/ipv4$ hppa64-linux-gcc -D__KERNEL__ -I/home/tausq/src/linux-2.4.19-rc1/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -D__linux__ -pipe -fno-strength-reduce -mno-space-regs -mfast-indirect-calls -mdisable-fpregs -ffunction-sections -march=2.0 -mschedule=8000   -nostdinc -I /usr/lib/gcc-lib/hppa64-linux/3.0/include -DKBUILD_BASENAME=tcp_diag  -c -o tcp_diag.o tcp_diag.c
{standard input}: Assembler messages:
{standard input}:138: Error: Field not properly aligned [8] (44).
{standard input}:138: Error: Invalid operands

The pa-risc tree has a disgusting hack to work around this. Its one of the bits I have down in the "vomit grade" pile of bits to look into during the rest of the merge.

#5 lore raw
In reply to Randolph Chung
Quoted 12 lines

Compiling the linux kernel (2.4.19-rc1-ac5) with hppa64-linux-gcc (3.0.4 or 3.2) gives:

tausq@a500:~/src/linux-2.4.19-rc1/net/ipv4$ hppa64-linux-gcc -D__KERNEL__ -I/home/tausq/src/linux-2.4.19-rc1/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -D__linux__ -pipe -fno-strength-reduce -mno-space-regs -mfast-indirect-calls -mdisable-fpregs -ffunction-sections -march=2.0 -mschedule=8000   -nostdinc -I /usr/lib/gcc-lib/hppa64-linux/3.0/include -DKBUILD_BASENAME=tcp_diag  -c -o tcp_diag.o tcp_diag.c
{standard input}: Assembler messages:
{standard input}:138: Error: Field not properly aligned [8] (44).
{standard input}:138: Error: Invalid operands
{standard input}:609: Error: Field not properly aligned [8] (44).
{standard input}:609: Error: Invalid operands
{standard input}:707: Error: Field not properly aligned [8] (44).
{standard input}:707: Error: Invalid operands
Quoted 5 lines

preprocessed source attached.

(incidentally, we also see this while building glibc...)

randolph

Preprocessed source attached?

Remember we ran into this when building glibc at OLS.... and we sat there scratching our heads. I'm pretty sure this was the reason for the hppa-align.dpatch that is part of debianzed gcc?

Randolph: There is a forward email inside the dpatch that says you were going to try get this patch upstream... ? :) (gcc 3.0.4 ./debian/patches/hppa-align.dpatch)

c.

#6 lore raw
Quoted 1 line

Preprocessed source attached?

I forgot it the first time, tried to send it again, but the source was too large and it got stopped for moderation...

Quoted 3 lines

Remember we ran into this when building glibc at OLS.... and we sat there scratching our heads. I'm pretty sure this was the reason for the hppa-align.dpatch that is part of debianzed gcc?

the hppa-align patch is for a different problem aiui, it's so that we don't do multiple ldcw's on the same cache line.

in any case, 3.0.4 (which has this patch) gives the same error.

Quoted 3 lines

Randolph: There is a forward email inside the dpatch that says you were going to try get this patch upstream... ? :) (gcc 3.0.4 ./debian/patches/hppa-align.dpatch)

I've tried, but the gcc folks have put in a different mechanism to do this, so the patch needs to be reworked, and i haven't gotten back to it yet.

randolph

Signature · 3 lines
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/
#7 lore raw
In reply to Randolph Chung
Quoted 11 lines

Compiling the linux kernel (2.4.19-rc1-ac5) with hppa64-linux-gcc (3.0.4 or 3.2) gives:

tausq@a500:~/src/linux-2.4.19-rc1/net/ipv4$ hppa64-linux-gcc -D__KERNEL__ -I/home/tausq/src/linux-2.4.19-rc1/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -D__linux__ -pipe -fno-strength-reduce -mno-space-regs -mfast-indirect-calls -mdisable-fpregs -ffunction-sections -march=2.0 -mschedule=8000   -nostdinc -I /usr/lib/gcc-lib/hppa64-linux/3.0/include -DKBUILD_BASENAME=tcp_diag  -c -o tcp_diag.o tcp_diag.c
{standard input}: Assembler messages:
{standard input}:138: Error: Field not properly aligned [8] (44).
{standard input}:138: Error: Invalid operands
{standard input}:609: Error: Field not properly aligned [8] (44).
{standard input}:609: Error: Invalid operands
{standard input}:707: Error: Field not properly aligned [8] (44).
{standard input}:707: Error: Invalid operands

These messages are coming from the assembler (remove "-pipe"). The first is from "std %r4,44(%r3)". The offset "44" is not correct for a store double. This is probably a problem with pointer arithmetic in the source.

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)
#8 lore raw
In reply to Randolph Chung
Quoted 11 lines

Compiling the linux kernel (2.4.19-rc1-ac5) with hppa64-linux-gcc (3.0.4 or 3.2) gives:

tausq@a500:~/src/linux-2.4.19-rc1/net/ipv4$ hppa64-linux-gcc -D__KERNEL__ -I/home/tausq/src/linux-2.4.19-rc1/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -D__linux__ -pipe -fno-strength-reduce -mno-space-regs -mfast-indirect-calls -mdisable-fpregs -ffunction-sections -march=2.0 -mschedule=8000   -nostdinc -I /usr/lib/gcc-lib/hppa64-linux/3.0/include -DKBUILD_BASENAME=tcp_diag  -c -o tcp_diag.o tcp_diag.c
{standard input}: Assembler messages:
{standard input}:138: Error: Field not properly aligned [8] (44).
{standard input}:138: Error: Invalid operands
{standard input}:609: Error: Field not properly aligned [8] (44).
{standard input}:609: Error: Invalid operands
{standard input}:707: Error: Field not properly aligned [8] (44).
{standard input}:707: Error: Invalid operands

These messages are coming from the assembler (remove "-pipe"). The first is from "std %r4,44(%r3)". The offset "44" is not correct for a store double. This is probably a problem with pointer arithmetic in the source.

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)