[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GNAT/RTEMS & floating point



This is a compiler bug tripped by the GNAT front end in conjunction with
the flags you are using.  Check out the "gnat-list" (not gnat-chat) and
the Linux Ada Project to see if someone has gnat running with egcs.  That
may be enough to fix this problem.  Unfortunately, fixing compiler front
end bugs is beyond my area of technical expertise.

I agree with you that it is unfortunate that gnat does not support
multilib. :(

--joel
Joel Sherrill                    Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985



On Wed, 17 Feb 1999, Tony R. Ambardar wrote:

> On Thu, 11 Feb 1999 joel at oarcorp.com wrote:
> > 
> > Software emulation of floating point is not implemented by gcc for the
> > i386.  It is included for other CPUs including the m68k.
> > 
> > It has been suggested before that one could take the FP unavailable
> > exception handler from somewhere (*BSD, go32, etc), and included it in
> > their system.  If you go this route, please try to stick to an
> > implementation that has licensing compatible with RTEMS and submit the
> > results of your effort.  It would be appareciated.
> > 
> > It has also been suggested that gcc be modified to include this support.
> > Other CPUs support it so there are examples.  This work should also be
> > submitted to the appropriate place. 
> > 
> > I hope this helps.
> > 
> > --joel
> 
> OK, I've modified GCC to do software floating-point emulation for my (or
> any) i386ex board, and I can successfully run and pass the paranoia.exe
> test.  Fortunately, the GCC code already existed but was disabled. 
> 
> Now I'm trying to get GNAT to use software floating-point as well, but I'm
> running into a few problems. For one thing GNAT does not support GCC's
> MULTILIB options, which means I explicitly have to add the options
> "-msoft-float -mno-fp-ret-in-387" when compiling gnatlib.
> 
> The bigger problem: GNAT/GCC errors when compiling some of the run-time
> system code. For example: (using gnat-3.11)
> 
> gcc -c -msoft-float -mno-fp-ret-in-387  -g -gnatpg a-ticoau.adb
> 
> a-ticoau.adb: In function `get':
> a-ticoau.adb:49: Unable to find a register to spill.
> (insn:HI 234 232 235 (set (mem:XF (plus:SI (reg:SI 6 %ebp)
>                 (const_int -12)))
>         (reg:XF 59)) 83 {movxf_mem+1} (nil)
>     (nil))
> +===========================GNAT BUG DETECTED=============================+
> | Error detected at a-ticoau.adb:64:7                                     |
> | Please submit bug report by email to report at gnat.com                    |
> | Use a subject line meaningful to you and us to track the bug            |
> | Include full sources in ASCII in a format compatible with gnatchop      |
> | First line of sources must be marked by an Ada -- comment line          |
> | Last line of sources must be last line of email message (no signature!) |
> | See gnatinfo.txt file for more info on procedure for submitting bugs    |
> | 3.11p  (981118) (i386-Ada95-linux-gnu) Gigi abort, Code=999             |
> +=========================================================================+
> compilation abandoned
> 
> The same thing also happens for a-wtcoau.adb and some others that use
> Long_Long_Float. Has anyone seen this before, or know a work-around, or
> can explain why this happens perhaps? I suspect GCC is running out of
> registers, but why doesn't it use memory...?
> 
> Could someone who has an EGCS-based gnat-3.11 please try compiling these
> to see if they work?
> 
> Thanks,
> Tony Ambardar
>   ____________________________________________________________
>  /                                                            \
> | Tony R. Ambardar         |   Department of Electrical &      |
> | M.Eng. Student           |   Computer Engineering            | 
> | Email: tonya at ece.ubc.ca  |   University of British Columbia  |
> | Ph: (604) 822-3611       |   2356 Main Mall, Vancouver B.C.  |
> | Fax:(604) 822-5949       |   V6T 1Z4  CANADA                 |
>  \____________________________________________________________/
> 
> 
>