This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Does -march=r5000 imply HAVE_64BIT_GPRS?


On Sat, Aug 18, 2001 at 06:33:40PM +0200, Thiemo Seufer wrote:
> H . J . Lu wrote:
> [snip]
> > I think it is not a bad idea. We can do
> > 
> >   if (mips_opts.isa != mips_isa_from_cpu)
> >     {
> >       /* -march=xxxx is not compatible with -mipsN.  */
> >       Issue a warning and abort.
> >     }
> > 
> > In fact, I have changed my CFLAGS from "-march=r5000 -mips2" to
> > "-mtune=r5000 -mips2". The problem with this approach is only
> > gcc 3.1 and my current mips toolchain support -mtune=r5000. Maybe
> > we should just add a warning to my patch, saying please use
> > "-mtune=XXX -mipsN" instead of "-march=XXX -mipsN".
> 
> I would suggest this patch.
> 
> 
> Thiemo
> 
> 
> 2001-08-18  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
> 
> 	/gas/ChangeLog
> 	* tc_mips.c (md_begin): Warn about incompatibility between -march=FOO
> 	and -mipsN option, continue with default ISA.
> 

I disagree. I think mips_tune should be set by -march=FOO in this case.

> 
> diff -BurpNX /bigdisk/src/binutils-exclude src-orig/gas/config/tc-mips.c src/gas/config/tc-mips.c
> --- src-orig/gas/config/tc-mips.c	Sun Aug 12 13:34:58 2001
> +++ src/gas/config/tc-mips.c	Sat Aug 18 17:54:58 2001
> @@ -996,7 +1015,20 @@ md_begin ()
>       the command line, or will be set otherwise if one was.  */
>    if (mips_arch != CPU_UNKNOWN && mips_opts.isa != ISA_UNKNOWN)
>      {
> -      /* We have it all.  There's nothing to do.  */
> +      /* We have to check if the isa is the default isa of arch.  Otherwise
> +         we'll get invalid object file headers.  */
> +      ci = mips_cpu_info_from_cpu (mips_arch);
> +      assert (ci != NULL);
> +      if (mips_opts.isa != ci->isa)
> +	{
> +	  /* This really should be an error instead of a warning, but old
> +	     compilers only have -mcpu which sets both arch and tune.  */
> +	  as_warn (_("The -march option is incompatible to -mipsN and "
> +		     "therefore ignored."));
> +	  ci = mips_cpu_info_from_isa (mips_opts.isa);
> +	  assert (ci != NULL);

Add

	  if (mips_tune == CPU_UNKNOWN)
	     mips_tune = mips_arch;


> +	  mips_arch = ci->cpu;
> +	}
>      }
>    else if (mips_arch != CPU_UNKNOWN && mips_opts.isa == ISA_UNKNOWN)
>      {


H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]