This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, ARM] Fix handling of -mhard-float and -msoft-float


I discovered this when I turned the multilibs for the FPA on in the
arm-elf configuration... I didn't get any FPA instructions :-(

This patch fixes the way we handle -mhard-float and -msoft-float so that
these options have the intended effect (the processing was wrong, so the
effect was that they both behaved as if -msoft-float was always
specified).

Tested by checking that the options generate the correct code for

double f() { return 1.0;}

with the corresponding command line options.

R.

2004-01-05  Richard Earnshaw  <rearnsha@arm.com>

	* arm.h (TARGET_OPTIONS): Correctly record -mhard-float and
	-msoft-float in target_float_switch.
	* arm.c (arm_override_options): Fix processing of target_float_switch.


Index: arm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.424
diff -p -r1.424 arm.c
*** arm.c	30 Dec 2004 03:07:41 -0000	1.424
--- arm.c	5 Jan 2005 11:51:30 -0000
*************** arm_override_options (void)
*** 1088,1094 ****
    else if (target_float_switch)
      {
        /* This is a bit of a hack to avoid needing target flags for these.  */
!       if (target_float_switch[1] == 'h')
  	arm_float_abi = ARM_FLOAT_ABI_HARD;
        else
  	arm_float_abi = ARM_FLOAT_ABI_SOFT;
--- 1088,1094 ----
    else if (target_float_switch)
      {
        /* This is a bit of a hack to avoid needing target flags for these.  */
!       if (target_float_switch[0] == 'h')
  	arm_float_abi = ARM_FLOAT_ABI_HARD;
        else
  	arm_float_abi = ARM_FLOAT_ABI_SOFT;
Index: arm.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.h,v
retrieving revision 1.263
diff -p -r1.263 arm.h
*** arm.h	30 Dec 2004 03:07:43 -0000	1.263
--- arm.h	5 Jan 2005 11:51:30 -0000
*************** extern GTY(()) rtx aof_pic_label;
*** 395,403 ****
     N_("Specify the register to be used for PIC addressing"), 0},	\
    {"abi=", &target_abi_name, N_("Specify an ABI"), 0},			\
    {"soft-float", &target_float_switch,					\
!    N_("Alias for -mfloat-abi=soft"), 0},				\
    {"hard-float", &target_float_switch,					\
!    N_("Alias for -mfloat-abi=hard"), 0}					\
  }
  
  /* Support for a compile-time default CPU, et cetera.  The rules are:
--- 395,403 ----
     N_("Specify the register to be used for PIC addressing"), 0},	\
    {"abi=", &target_abi_name, N_("Specify an ABI"), 0},			\
    {"soft-float", &target_float_switch,					\
!    N_("Alias for -mfloat-abi=soft"), "s"},				\
    {"hard-float", &target_float_switch,					\
!    N_("Alias for -mfloat-abi=hard"), "h"}				\
  }
  
  /* Support for a compile-time default CPU, et cetera.  The rules are:

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