The 'use -fPIC' hack I've been using to avoid this problem doesn't help with
the newest gcc in sid.
<
https://buildd.debian.org/fetch.cgi?pkg=mlton&arch=mips&ver=20100504~svn-r7459&stamp=1273006902&file=log&as=raw
>
gcc -std=gnu99 -c -I/usr/lib/mlton/targets/self/include \
-I/usr/
reopen 552314
thanks
Well, whatever was changed in the latest gcc makes gcc stop
complaining that a branch is out of range. However, the problem is NOT
fixed. Instead of the compiler aborting, it now creates broken object
code that will segfault on whatever code previously triggered this
behaviour
retitle 327351 libc rounding is broken on HPPAreassign 327351 libc6tags 327351 +patchthanksOn Sep 9, 2005, at 3:25 PM, Wesley W. Terpstra wrote:On Sep 9, 2005, at 3:11 PM, Falk Hueffner wrote:"Wesley W. Terpstra" <[EMAIL PROTECTED]> writes: __asm__ ("fstd %%fr0,0(%1)&qu
On Sep 9, 2005, at 3:11 PM, Falk Hueffner wrote:"Wesley W. Terpstra" <[EMAIL PROTECTED]> writes: __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw)); sw[0] &= ~FE_DOWNWARD; sw[0] |= round; __asm__ ("fldd 0(%0),%%fr0" : : "r
Here's a small test-case:
#include
#include
#include
int cvt(float f) { return (int)rint(f); }
int main() {
printf("%d %d %d %d\n", cvt(23.7), cvt(23.23), cvt(-23.7),
cvt(-23.23));
fesetround(FE_TONEAREST);
printf("%d %d %d %d\n", cvt(23.7), cvt(23.23), cvt(-23.7),
Package: gcc-4.0
Version: 4.0.1-6
Severity: important
When compiling the fesetround function (which controls the processor
rounding mode), gcc-4.0 incorrectly optimizes away the code!!!
Here's the C code in question:
__asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
sw[0] &= ~FE_DOWNWARD;
6 matches
Mail list logo