Seg fault building Newlib

OP #1171471
This is the error message:

gcc -I/e/projects/newlib/newlib-1.14.0/newlib/targ-include
-I/e/projects/newlib/newlib-1.14.0/newlib/libc/include
-DPACKAGE=\"newlib\" -DVERSION=\"1.14.0\"  -I. -I.  -I./../common -O2
-D__NO_SYSCALLS__ -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY -fno-builtin
-mfpu=vfp -mfloat-abi=softfp -mhard-float -mthumb-interwork
-mlittle-endian    -g -c s_floor.c
s_floor.c: In function 'floor':
s_floor.c:90: internal compiler error: Segmentation fault

Compiler: gcc version 4.0.2 (WinARM)

This fault occurs specifically with -mfpu=vfp -mfloat-abi=softfp
(suggested here:
http://www.codesourcery.com/gnu_toolchains/arm/faq.html#q_usage_use_vfp).
The occurance of the fault is influenced by the source being compiled,
since other sources with floating point code have compiled. I have also
seen this error in code I used for evaluating the Philips LPC3180, teh
problem went away when I modified the code. Unfortunately I do not have
the details.

I understand that few of you have need for VFP code, but if anybody has
any ideas, solutions, or knows if it persists in 4.1.1 I'd be
interested.

Thanks,

Clifford
OP #1171472
I have narrowed it down and can reproduce the error with the following:

arm-elf-gcc -c -O2 -mfpu=vfp -mfloat-abi=softfp test.c

where test.c contains:

void test( double x )
{
  return( x >= 0 ? 0 : -1.0 ) ;
}

In fact any expression in the return involving an inequality against x
seems to cause the problem. This code was simply a hack of the code in
mathfp\s_floor.c until I got the smallest code that failed without any
dependencies.

It is the combination -mfpu=vfp and any level of optimisation other than
zero (i.e. no optimisation) that causes the problem. Now I've simplified
it, if someone could try this on GCC 4.1.1 before I risk an upgrade I'd
appreciate it.


Thanks

Clifford
OP #1171473
Clifford Slocombe wrote:
> ... if someone could try this on GCC 4.1.1 before I risk an upgrade I'd
> appreciate it.

I have now done this myself and can verify the 4.1.1 does not exhibit
this problem.

Clifford

Reply

A question of your own? This thread is over 20 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.