This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [m68k] Fix PR target/13292: -msoft-float seems to corrupt builtin defines
On Tue, Jun 15, 2004 at 07:46:27PM +0200, Bernardo Innocenti wrote:
> Gunther Nikl wrote:
> >On Tue, Jun 15, 2004 at 02:21:34PM +0200, Bernardo Innocenti wrote:
> >
> >>Gunther Nikl wrote:
> >>
> >>>On Sat, Jun 12, 2004 at 04:40:11AM +0200, Bernardo Innocenti wrote:
> >>>
> >>>
> >>>>The -msoft-float option incorrectly removed MASK_68040_ONLY
> >>>>in addition to MASK_68881. This leads to incorrect
> >>>>predefines and unwanted degradation of integer code.
> >>>>
> >>>>There was just one place where we were using
> >>>>TARGET_68040_ONLY to generate a floating-point
> >>>>instruction without taking TARGET_68881 into account.
> >>>>
> >>>>Tested on m68k-unknown-uclinux by comparing assembly
> >>>>output of some selected testcases from gcc.c-torture.
> >>>>
> >>>>OK for mainline? 3_4-branch?
> >>>
> >>>Shouldn't this go to the 3.3 branch as well?
> >>
> >>I clearly remember posting the patch to reorganize the m68k predefines
> >>during the 3.4 timeframe.
> >
> > I didn't notice that this reorganization affects this patch.
>
> [See below]
>
> >>Before that patch, we had that mess with CPP_SPEC which used to set
> >>all of the __m680x0__ predefines even in the 68040 case, which was
> >>inappropriate but consistent with previous versions of GCC.
> >
> >
> > I thought this patch corrects an inapproriate usage of
> > TARGET_68040_ONLY where GCC didn't generate valid 68040 integer
> > instructions. Where is the conflicht with the predefines?
>
> The patch was primary meant to fix PR13292, which is about
> the __m680x0__ (with x=1,2,3) predefines magically appearing
> when one specifies -msoft-float along with -m68040.
Ah ok. Since on 3.3+ most (all?) targets still uses CPP_SPEC and friends
this problem isn't there. With the AmigaOS port the effect is slightly
different because the port uses TARGET_CPU_CPP_BUILTINS since 3.3 and it
doesn't handle -m68020-[46]0 the way its done in 3.4/mainline. In my
case -m680[46]0 -msoft-float defines mc68020.
> I vaguely remember you objecting that the new predefines made it hard
> to do something useful in math-68881.h. Is it still the case with this
> patch applied?
I think so because math-68881.h is conditionalized on HAVE_68881 which
is defined by -m680[46]0.
> If so, what was the original workaround you had suggested?
I decided to keep the definizion of HAVE_68881 in CPP_SPEC. This has
other problems :-/
Gunther