public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, i386]: Fix PR89221, --enable-frame-pointer does not work as intended
@ 2019-02-08 12:25 Uros Bizjak
  2019-02-10 19:52 ` [PATCH v2, " Uros Bizjak
  0 siblings, 1 reply; 6+ messages in thread
From: Uros Bizjak @ 2019-02-08 12:25 UTC (permalink / raw)
  To: gcc-patches; +Cc: Rainer Orth, Eric Botcazou

[-- Attachment #1: Type: text/plain, Size: 711 bytes --]

Hello!

Attached patch fixes --enable-frame-pointer handling, and this way
makes a couple of defines in config/i386/sol2.h obsolete.

2019-02-08  Uroš Bizjak  <ubizjak@gmail.com>

    PR target/89221
    * config.gcc (i[34567]86-*-*, x86_64-*-*): Move tests for enable_cld
    and enable_frame_pointer ...
    * configure.ac: ... here.  Update help strings for --enable-cld and
    --enable-frame-pointer.
    (x86_64_*-*): Use USE_X86_64_FRAME_POINTER define.
    * configure: Regenerate.
    * config/i386/sol2.h (USE_IX86_FRAME_POINTER): Remove.
    (USE_X86_64_FRAME_POINTER): Ditto.

Bootstrapped non x86_64-linux-gnu. Rainer, can you please test the
patch on solaris2 target?

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 5402 bytes --]

Index: config/i386/sol2.h
===================================================================
--- config/i386/sol2.h	(revision 268670)
+++ config/i386/sol2.h	(working copy)
@@ -248,9 +248,6 @@
 #define ASAN_REJECT_SPEC \
   DEF_ARCH64_SPEC("%e:-fsanitize=address is not supported in this configuration")
 
-#define USE_IX86_FRAME_POINTER 1
-#define USE_X86_64_FRAME_POINTER 1
-
 #undef NO_PROFILE_COUNTERS
 
 #undef MCOUNT_NAME
Index: config.gcc
===================================================================
--- config.gcc	(revision 268670)
+++ config.gcc	(working copy)
@@ -604,12 +604,6 @@
 		echo "This target does not support --with-abi."
 		exit 1
 	fi
-	if test "x$enable_cld" = xyes; then
-		tm_defines="${tm_defines} USE_IX86_CLD=1"
-	fi
-	if test "x$enable_frame_pointer" = xyes; then
-		tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1"
-	fi
 	;;
 x86_64-*-*)
 	case ${with_abi} in
@@ -630,12 +624,6 @@
 		echo "Unknown ABI used in --with-abi=$with_abi"
 		exit 1
 	esac
-	if test "x$enable_cld" = xyes; then
-		tm_defines="${tm_defines} USE_IX86_CLD=1"
-	fi
-	if test "x$enable_frame_pointer" = xyes; then
-		tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1"
-	fi
 	;;
 arm*-*-*)
 	tm_p_file="arm/arm-flags.h ${tm_p_file} arm/aarch-common-protos.h"
Index: configure
===================================================================
--- configure	(revision 268670)
+++ configure	(working copy)
@@ -1687,9 +1687,8 @@
                           Link mingw executables with --large-address-aware
   --enable-leading-mingw64-underscores
                           enable leading underscores on 64 bit mingw targets
-  --enable-cld            enable -mcld by default for 32bit x86
-  --enable-frame-pointer  enable -fno-omit-frame-pointer by default for 32bit
-                          x86
+  --enable-cld            enable -mcld by default for x86
+  --enable-frame-pointer  enable -fno-omit-frame-pointer by default for x86
   --disable-win32-registry
                           disable lookup of installation paths in the Registry
                           on Windows hosts
@@ -12199,8 +12198,7 @@
 
 case $target_os in
 linux* | darwin[8912]*)
-  # Enable -fomit-frame-pointer by default for Linux and Darwin with
-  # DWARF2.
+  # Enable -fomit-frame-pointer by default for Linux and Darwin with DWARF2.
   enable_frame_pointer=no
   ;;
 *)
@@ -12211,6 +12209,25 @@
 fi
 
 
+case $target in
+i[34567]86-*-*)
+	if test "x$enable_cld" = xyes; then
+		tm_defines="${tm_defines} USE_IX86_CLD=1"
+	fi
+	if test "x$enable_frame_pointer" = xyes; then
+		tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1"
+	fi
+	;;
+x86_64-*-*)
+	if test "x$enable_cld" = xyes; then
+		tm_defines="${tm_defines} USE_IX86_CLD=1"
+	fi
+	if test "x$enable_frame_pointer" = xyes; then
+		tm_defines="${tm_defines} USE_X86_64_FRAME_POINTER=1"
+	fi
+	;;
+esac
+
 # Windows32 Registry support for specifying GCC installation paths.
 # Check whether --enable-win32-registry was given.
 if test "${enable_win32_registry+set}" = set; then :
@@ -18646,7 +18663,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18640 "configure"
+#line 18666 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18752,7 +18769,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18746 "configure"
+#line 18772 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -25141,7 +25158,7 @@
           no)
             ;;
           *)
-            as_fn_error "'$enableval' is an invalid value for --enable-standard-branch-protection.\
+            as_fn_error $? "'$enableval' is an invalid value for --enable-standard-branch-protection.\
   Valid choices are 'yes' and 'no'." "$LINENO" 5
             ;;
         esac
Index: configure.ac
===================================================================
--- configure.ac	(revision 268670)
+++ configure.ac	(working copy)
@@ -1876,17 +1876,16 @@
     [Define if we should use leading underscore on 64 bit mingw targets])])
 
 AC_ARG_ENABLE(cld,
-[AS_HELP_STRING([--enable-cld], [enable -mcld by default for 32bit x86])], [],
+[AS_HELP_STRING([--enable-cld], [enable -mcld by default for x86])], [],
 [enable_cld=no])
 
 AC_ARG_ENABLE(frame-pointer,
 [AS_HELP_STRING([--enable-frame-pointer],
-		[enable -fno-omit-frame-pointer by default for 32bit x86])], [],
+		[enable -fno-omit-frame-pointer by default for x86])], [],
 [
 case $target_os in
 linux* | darwin[[8912]]*)
-  # Enable -fomit-frame-pointer by default for Linux and Darwin with
-  # DWARF2.
+  # Enable -fomit-frame-pointer by default for Linux and Darwin with DWARF2.
   enable_frame_pointer=no
   ;;
 *)
@@ -1895,6 +1894,25 @@
 esac
 ])
 
+case $target in
+i[[34567]]86-*-*)
+	if test "x$enable_cld" = xyes; then
+		tm_defines="${tm_defines} USE_IX86_CLD=1"
+	fi
+	if test "x$enable_frame_pointer" = xyes; then
+		tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1"
+	fi
+	;;
+x86_64-*-*)
+	if test "x$enable_cld" = xyes; then
+		tm_defines="${tm_defines} USE_IX86_CLD=1"
+	fi
+	if test "x$enable_frame_pointer" = xyes; then
+		tm_defines="${tm_defines} USE_X86_64_FRAME_POINTER=1"
+	fi
+	;;
+esac
+
 # Windows32 Registry support for specifying GCC installation paths.
 AC_ARG_ENABLE(win32-registry,
 [AS_HELP_STRING([--disable-win32-registry],

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2, i386]: Fix PR89221, --enable-frame-pointer does not work as intended
  2019-02-08 12:25 [PATCH, i386]: Fix PR89221, --enable-frame-pointer does not work as intended Uros Bizjak
@ 2019-02-10 19:52 ` Uros Bizjak
  2019-02-11  8:25   ` Rainer Orth
  2019-05-09  9:55   ` [committed] [PR89221] Continue to default to '--disable-frame-pointer' for x86 GNU systems (was: [PATCH v2, i386]: Fix PR89221, --enable-frame-pointer does not work as intended) Thomas Schwinge
  0 siblings, 2 replies; 6+ messages in thread
From: Uros Bizjak @ 2019-02-10 19:52 UTC (permalink / raw)
  To: gcc-patches, Jonathan Yong; +Cc: Rainer Orth, Eric Botcazou, H. J. Lu

[-- Attachment #1: Type: text/plain, Size: 1316 bytes --]

On Fri, Feb 8, 2019 at 1:24 PM Uros Bizjak <ubizjak@gmail.com> wrote:

> Attached patch fixes --enable-frame-pointer handling, and this way
> makes a couple of defines in config/i386/sol2.h obsolete.

It turned out that --enable-frame-pointer does not work for multilibs
at all. So, instead of pretending that -m32 on x86_64 and -m64 on i686
works as advertised, unify 32bit and 64bit handling.

2019-02-10  Uroš Bizjak  <ubizjak@gmail.com>

    PR target/89221
    * config.gcc (i[34567]86-*-*, x86_64-*-*): Move tests for enable_cld
    and enable_frame_pointer ...
    * configure.ac: ... here.  Update help strings for
    --enable-frame-pointer.
    * configure: Regenerate.
    * config/i386/i386.c (ix86_option_override_internal): Remove
    USE_X86_64_FRAME_POINTER define, use USE_IX86_FRAME_POINTER instead.
    * config/i386/sol2.h (USE_IX86_FRAME_POINTER): Remove.
    (USE_X86_64_FRAME_POINTER): Ditto.

Please note that this fix will re-enable frame pointer for all targets
but linux* or darwin[[8912]]. However, since builds for e.g. cygwin
and mingw survived just well without frame pointers in the mean time,
we should probably list these targets as targets without frame
pointers by default. Maintainers should decide.

Which makes the patch gcc-10 material.

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 4643 bytes --]

Index: config/i386/sol2.h
===================================================================
--- config/i386/sol2.h	(revision 268670)
+++ config/i386/sol2.h	(working copy)
@@ -248,9 +248,6 @@
 #define ASAN_REJECT_SPEC \
   DEF_ARCH64_SPEC("%e:-fsanitize=address is not supported in this configuration")
 
-#define USE_IX86_FRAME_POINTER 1
-#define USE_X86_64_FRAME_POINTER 1
-
 #undef NO_PROFILE_COUNTERS
 
 #undef MCOUNT_NAME
Index: config.gcc
===================================================================
--- config.gcc	(revision 268670)
+++ config.gcc	(working copy)
@@ -604,12 +604,6 @@
 		echo "This target does not support --with-abi."
 		exit 1
 	fi
-	if test "x$enable_cld" = xyes; then
-		tm_defines="${tm_defines} USE_IX86_CLD=1"
-	fi
-	if test "x$enable_frame_pointer" = xyes; then
-		tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1"
-	fi
 	;;
 x86_64-*-*)
 	case ${with_abi} in
@@ -630,12 +624,6 @@
 		echo "Unknown ABI used in --with-abi=$with_abi"
 		exit 1
 	esac
-	if test "x$enable_cld" = xyes; then
-		tm_defines="${tm_defines} USE_IX86_CLD=1"
-	fi
-	if test "x$enable_frame_pointer" = xyes; then
-		tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1"
-	fi
 	;;
 arm*-*-*)
 	tm_p_file="arm/arm-flags.h ${tm_p_file} arm/aarch-common-protos.h"
Index: configure
===================================================================
--- configure	(revision 268670)
+++ configure	(working copy)
@@ -1688,8 +1688,7 @@
   --enable-leading-mingw64-underscores
                           enable leading underscores on 64 bit mingw targets
   --enable-cld            enable -mcld by default for 32bit x86
-  --enable-frame-pointer  enable -fno-omit-frame-pointer by default for 32bit
-                          x86
+  --enable-frame-pointer  enable -fno-omit-frame-pointer by default for x86
   --disable-win32-registry
                           disable lookup of installation paths in the Registry
                           on Windows hosts
@@ -12199,8 +12198,7 @@
 
 case $target_os in
 linux* | darwin[8912]*)
-  # Enable -fomit-frame-pointer by default for Linux and Darwin with
-  # DWARF2.
+  # Enable -fomit-frame-pointer by default for Linux and Darwin with DWARF2.
   enable_frame_pointer=no
   ;;
 *)
@@ -12211,6 +12209,17 @@
 fi
 
 
+case $target in
+i[34567]86-*-* | x86_64-*-*)
+	if test "x$enable_cld" = xyes; then
+		tm_defines="${tm_defines} USE_IX86_CLD=1"
+	fi
+	if test "x$enable_frame_pointer" = xyes; then
+		tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1 USE_X86_64_FRAME_POINTER=1"
+	fi
+	;;
+esac
+
 # Windows32 Registry support for specifying GCC installation paths.
 # Check whether --enable-win32-registry was given.
 if test "${enable_win32_registry+set}" = set; then :
@@ -18646,7 +18655,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18640 "configure"
+#line 18658 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18752,7 +18761,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18746 "configure"
+#line 18764 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -25141,7 +25150,7 @@
           no)
             ;;
           *)
-            as_fn_error "'$enableval' is an invalid value for --enable-standard-branch-protection.\
+            as_fn_error $? "'$enableval' is an invalid value for --enable-standard-branch-protection.\
   Valid choices are 'yes' and 'no'." "$LINENO" 5
             ;;
         esac
Index: configure.ac
===================================================================
--- configure.ac	(revision 268670)
+++ configure.ac	(working copy)
@@ -1881,12 +1881,11 @@
 
 AC_ARG_ENABLE(frame-pointer,
 [AS_HELP_STRING([--enable-frame-pointer],
-		[enable -fno-omit-frame-pointer by default for 32bit x86])], [],
+		[enable -fno-omit-frame-pointer by default for x86])], [],
 [
 case $target_os in
 linux* | darwin[[8912]]*)
-  # Enable -fomit-frame-pointer by default for Linux and Darwin with
-  # DWARF2.
+  # Enable -fomit-frame-pointer by default for Linux and Darwin with DWARF2.
   enable_frame_pointer=no
   ;;
 *)
@@ -1895,6 +1894,17 @@
 esac
 ])
 
+case $target in
+i[[34567]]86-*-* | x86_64-*-*)
+	if test "x$enable_cld" = xyes; then
+		tm_defines="${tm_defines} USE_IX86_CLD=1"
+	fi
+	if test "x$enable_frame_pointer" = xyes; then
+		tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1 USE_X86_64_FRAME_POINTER=1"
+	fi
+	;;
+esac
+
 # Windows32 Registry support for specifying GCC installation paths.
 AC_ARG_ENABLE(win32-registry,
 [AS_HELP_STRING([--disable-win32-registry],

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2, i386]: Fix PR89221, --enable-frame-pointer does not work as intended
  2019-02-10 19:52 ` [PATCH v2, " Uros Bizjak
@ 2019-02-11  8:25   ` Rainer Orth
  2019-05-06 15:00     ` Uros Bizjak
  2019-05-09  9:55   ` [committed] [PR89221] Continue to default to '--disable-frame-pointer' for x86 GNU systems (was: [PATCH v2, i386]: Fix PR89221, --enable-frame-pointer does not work as intended) Thomas Schwinge
  1 sibling, 1 reply; 6+ messages in thread
From: Rainer Orth @ 2019-02-11  8:25 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches, Jonathan Yong, Eric Botcazou, H. J. Lu

Hi Uros,

> On Fri, Feb 8, 2019 at 1:24 PM Uros Bizjak <ubizjak@gmail.com> wrote:
>
>> Attached patch fixes --enable-frame-pointer handling, and this way
>> makes a couple of defines in config/i386/sol2.h obsolete.
>
> It turned out that --enable-frame-pointer does not work for multilibs
> at all. So, instead of pretending that -m32 on x86_64 and -m64 on i686
> works as advertised, unify 32bit and 64bit handling.

this is effectively what I came up with when testing the first version
of the patch on i386-pc-solaris2.11 and noticing the -m64 regressions.

I've now re-bootstrapped this exact version without regressions, so from
a Solaris/x86 POV this is good to go.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2, i386]: Fix PR89221, --enable-frame-pointer does not work as intended
  2019-02-11  8:25   ` Rainer Orth
@ 2019-05-06 15:00     ` Uros Bizjak
  0 siblings, 0 replies; 6+ messages in thread
From: Uros Bizjak @ 2019-05-06 15:00 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches, Jonathan Yong, Eric Botcazou, H. J. Lu

[-- Attachment #1: Type: text/plain, Size: 835 bytes --]

On Mon, Feb 11, 2019 at 9:25 AM Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
>
> Hi Uros,
>
> > On Fri, Feb 8, 2019 at 1:24 PM Uros Bizjak <ubizjak@gmail.com> wrote:
> >
> >> Attached patch fixes --enable-frame-pointer handling, and this way
> >> makes a couple of defines in config/i386/sol2.h obsolete.
> >
> > It turned out that --enable-frame-pointer does not work for multilibs
> > at all. So, instead of pretending that -m32 on x86_64 and -m64 on i686
> > works as advertised, unify 32bit and 64bit handling.
>
> this is effectively what I came up with when testing the first version
> of the patch on i386-pc-solaris2.11 and noticing the -m64 regressions.
>
> I've now re-bootstrapped this exact version without regressions, so from
> a Solaris/x86 POV this is good to go.

Now committed to mainline SVN as attached.

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 5099 bytes --]

Index: config/i386/i386-options.c
===================================================================
--- config/i386/i386-options.c	(revision 270904)
+++ config/i386/i386-options.c	(working copy)
@@ -2198,16 +2198,12 @@
 #define USE_IX86_FRAME_POINTER 0
 #endif
 
-#ifndef USE_X86_64_FRAME_POINTER
-#define USE_X86_64_FRAME_POINTER 0
-#endif
-
   /* Set the default values for switches whose default depends on TARGET_64BIT
      in case they weren't overwritten by command line options.  */
   if (TARGET_64BIT_P (opts->x_ix86_isa_flags))
     {
       if (opts->x_optimize >= 1 && !opts_set->x_flag_omit_frame_pointer)
-	opts->x_flag_omit_frame_pointer = !USE_X86_64_FRAME_POINTER;
+	opts->x_flag_omit_frame_pointer = !USE_IX86_FRAME_POINTER;
       if (opts->x_flag_asynchronous_unwind_tables
 	  && !opts_set->x_flag_unwind_tables
 	  && TARGET_64BIT_MS_ABI)
Index: config/i386/sol2.h
===================================================================
--- config/i386/sol2.h	(revision 270904)
+++ config/i386/sol2.h	(working copy)
@@ -248,9 +248,6 @@
 #define ASAN_REJECT_SPEC \
   DEF_ARCH64_SPEC("%e:-fsanitize=address is not supported in this configuration")
 
-#define USE_IX86_FRAME_POINTER 1
-#define USE_X86_64_FRAME_POINTER 1
-
 #undef NO_PROFILE_COUNTERS
 
 #undef MCOUNT_NAME
Index: config.gcc
===================================================================
--- config.gcc	(revision 270913)
+++ config.gcc	(working copy)
@@ -607,12 +607,6 @@
 		echo "This target does not support --with-abi."
 		exit 1
 	fi
-	if test "x$enable_cld" = xyes; then
-		tm_defines="${tm_defines} USE_IX86_CLD=1"
-	fi
-	if test "x$enable_frame_pointer" = xyes; then
-		tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1"
-	fi
 	;;
 x86_64-*-*)
 	case ${with_abi} in
@@ -633,12 +627,6 @@
 		echo "Unknown ABI used in --with-abi=$with_abi"
 		exit 1
 	esac
-	if test "x$enable_cld" = xyes; then
-		tm_defines="${tm_defines} USE_IX86_CLD=1"
-	fi
-	if test "x$enable_frame_pointer" = xyes; then
-		tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1"
-	fi
 	;;
 arm*-*-*)
 	tm_p_file="arm/arm-flags.h ${tm_p_file} arm/aarch-common-protos.h"
Index: configure
===================================================================
--- configure	(revision 270904)
+++ configure	(working copy)
@@ -1688,8 +1688,7 @@
   --enable-leading-mingw64-underscores
                           enable leading underscores on 64 bit mingw targets
   --enable-cld            enable -mcld by default for 32bit x86
-  --enable-frame-pointer  enable -fno-omit-frame-pointer by default for 32bit
-                          x86
+  --enable-frame-pointer  enable -fno-omit-frame-pointer by default for x86
   --disable-win32-registry
                           disable lookup of installation paths in the Registry
                           on Windows hosts
@@ -12199,8 +12198,7 @@
 
 case $target_os in
 linux* | darwin[8912]*)
-  # Enable -fomit-frame-pointer by default for Linux and Darwin with
-  # DWARF2.
+  # Enable -fomit-frame-pointer by default for Linux and Darwin with DWARF2.
   enable_frame_pointer=no
   ;;
 *)
@@ -12211,6 +12209,17 @@
 fi
 
 
+case $target in
+i[34567]86-*-* | x86_64-*-*)
+	if test "x$enable_cld" = xyes; then
+		tm_defines="${tm_defines} USE_IX86_CLD=1"
+	fi
+	if test "x$enable_frame_pointer" = xyes; then
+		tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1"
+	fi
+	;;
+esac
+
 # Windows32 Registry support for specifying GCC installation paths.
 # Check whether --enable-win32-registry was given.
 if test "${enable_win32_registry+set}" = set; then :
@@ -18646,7 +18655,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18649 "configure"
+#line 18658 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18752,7 +18761,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18755 "configure"
+#line 18764 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
Index: configure.ac
===================================================================
--- configure.ac	(revision 270904)
+++ configure.ac	(working copy)
@@ -1881,12 +1881,11 @@
 
 AC_ARG_ENABLE(frame-pointer,
 [AS_HELP_STRING([--enable-frame-pointer],
-		[enable -fno-omit-frame-pointer by default for 32bit x86])], [],
+		[enable -fno-omit-frame-pointer by default for x86])], [],
 [
 case $target_os in
 linux* | darwin[[8912]]*)
-  # Enable -fomit-frame-pointer by default for Linux and Darwin with
-  # DWARF2.
+  # Enable -fomit-frame-pointer by default for Linux and Darwin with DWARF2.
   enable_frame_pointer=no
   ;;
 *)
@@ -1895,6 +1894,17 @@
 esac
 ])
 
+case $target in
+i[[34567]]86-*-* | x86_64-*-*)
+	if test "x$enable_cld" = xyes; then
+		tm_defines="${tm_defines} USE_IX86_CLD=1"
+	fi
+	if test "x$enable_frame_pointer" = xyes; then
+		tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1"
+	fi
+	;;
+esac
+
 # Windows32 Registry support for specifying GCC installation paths.
 AC_ARG_ENABLE(win32-registry,
 [AS_HELP_STRING([--disable-win32-registry],

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [committed] [PR89221] Continue to default to '--disable-frame-pointer' for x86 GNU systems (was: [PATCH v2, i386]: Fix PR89221, --enable-frame-pointer does not work as intended)
  2019-02-10 19:52 ` [PATCH v2, " Uros Bizjak
  2019-02-11  8:25   ` Rainer Orth
@ 2019-05-09  9:55   ` Thomas Schwinge
  2019-05-13 10:16     ` [PATCH, i386]: --enable-frame-pointer for cygwin and mingw Uros Bizjak
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Schwinge @ 2019-05-09  9:55 UTC (permalink / raw)
  To: Uros Bizjak, gcc-patches
  Cc: Rainer Orth, Eric Botcazou, H. J. Lu, Jonathan Yong, bug-hurd,
	debian-bsd


[-- Attachment #1.1: Type: text/plain, Size: 893 bytes --]

Hi!

On Sun, 10 Feb 2019 20:51:39 +0100, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Fri, Feb 8, 2019 at 1:24 PM Uros Bizjak <ubizjak@gmail.com> wrote:
> > Attached patch fixes --enable-frame-pointer handling [...]

ACK.

> Please note that this fix will re-enable frame pointer for all targets
> but linux* or darwin[[8912]]. However, since builds for e.g. cygwin
> and mingw survived just well without frame pointers in the mean time,
> we should probably list these targets as targets without frame
> pointers by default.

I agree, this would cause the least surprise, to simply keep the previous
default of '--disable-frame-pointer'.  Until such a global change is
agreed on, and made...

> Maintainers should decide.

The GNU/Hurd maintainer has decided (and also made a decision for
GNU/k*BSD); committed the attached to trunk in r271028.


Grüße
 Thomas



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-PR89221-Continue-to-default-to-disable-frame-p.trunk.patch --]
[-- Type: text/x-diff, Size: 2660 bytes --]

From 679a49952fe543043047267cc8500c5cc1065b7b Mon Sep 17 00:00:00 2001
From: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 9 May 2019 09:51:59 +0000
Subject: [PATCH] [PR89221] Continue to default to '--disable-frame-pointer'
 for x86 GNU systems

The recent trunk r270914 for PR89221 "--enable-frame-pointer does not work as
intended" fixed a scripting defect in the x86 '--enable-frame-pointer'
handling.

This has the side effect that, for example, for '--target=i686-gnu' this is now
enabled by default: 'USE_IX86_FRAME_POINTER=1' is added to 'tm_defines'.  Given
that it's highly unlikely that anyone would now suddenly want
'--enable-frame-pointer' as the default for any kind of GNU system, I'm
changing the default back for GNU systems, to match that of a 'target_os' of
'linux* | darwin[8912]*'.

	gcc/
	PR target/89221
	* configure.ac (--enable-frame-pointer): Disable by default for
	GNU systems.
	* configure: Regenerate.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271028 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog    | 7 +++++++
 gcc/configure    | 4 ++--
 gcc/configure.ac | 4 ++--
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 37447f854c0..ea96146b5b8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2019-05-09  Thomas Schwinge  <thomas@codesourcery.com>
+
+	PR target/89221
+	* configure.ac (--enable-frame-pointer): Disable by default for
+	GNU systems.
+	* configure: Regenerate.
+
 2019-05-09  Alan Modra  <amodra@gmail.com>
 
 	PR target/89271
diff --git a/gcc/configure b/gcc/configure
index 08cce6f1980..947d263a617 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -12197,8 +12197,8 @@ if test "${enable_frame_pointer+set}" = set; then :
 else
 
 case $target_os in
-linux* | darwin[8912]*)
-  # Enable -fomit-frame-pointer by default for Linux and Darwin with DWARF2.
+linux* | gnu* | darwin[8912]*)
+  # Enable -fomit-frame-pointer by default for these systems with DWARF2.
   enable_frame_pointer=no
   ;;
 *)
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 7c526b9ada4..bfcdf526e44 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1884,8 +1884,8 @@ AC_ARG_ENABLE(frame-pointer,
 		[enable -fno-omit-frame-pointer by default for x86])], [],
 [
 case $target_os in
-linux* | darwin[[8912]]*)
-  # Enable -fomit-frame-pointer by default for Linux and Darwin with DWARF2.
+linux* | gnu* | darwin[[8912]]*)
+  # Enable -fomit-frame-pointer by default for these systems with DWARF2.
   enable_frame_pointer=no
   ;;
 *)
-- 
2.17.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 658 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH, i386]: --enable-frame-pointer for cygwin and mingw
  2019-05-09  9:55   ` [committed] [PR89221] Continue to default to '--disable-frame-pointer' for x86 GNU systems (was: [PATCH v2, i386]: Fix PR89221, --enable-frame-pointer does not work as intended) Thomas Schwinge
@ 2019-05-13 10:16     ` Uros Bizjak
  0 siblings, 0 replies; 6+ messages in thread
From: Uros Bizjak @ 2019-05-13 10:16 UTC (permalink / raw)
  To: Thomas Schwinge
  Cc: gcc-patches, Rainer Orth, Eric Botcazou, H. J. Lu, Jonathan Yong,
	bug-hurd, debian-bsd

[-- Attachment #1: Type: text/plain, Size: 1068 bytes --]

On Thu, May 9, 2019 at 11:55 AM Thomas Schwinge <thomas@codesourcery.com> wrote:

> On Sun, 10 Feb 2019 20:51:39 +0100, Uros Bizjak <ubizjak@gmail.com> wrote:
> > On Fri, Feb 8, 2019 at 1:24 PM Uros Bizjak <ubizjak@gmail.com> wrote:
> > > Attached patch fixes --enable-frame-pointer handling [...]
>
> ACK.
>
> > Please note that this fix will re-enable frame pointer for all targets
> > but linux* or darwin[[8912]]. However, since builds for e.g. cygwin
> > and mingw survived just well without frame pointers in the mean time,
> > we should probably list these targets as targets without frame
> > pointers by default.
>
> I agree, this would cause the least surprise, to simply keep the previous
> default of '--disable-frame-pointer'.  Until such a global change is
> agreed on, and made...

I plan to commit the attached patch later today.

2019-05-13  Uroš Bizjak  <ubizjak@gmail.com>

    PR target/89221
    * configure.ac (--enable-frame-pointer):
    Disable by default for cygwin and mingw.
    * configure: Regenerate.

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 884 bytes --]

diff --git a/gcc/configure b/gcc/configure
index 947d263a6174..3cab176e5018 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -12197,7 +12197,7 @@ if test "${enable_frame_pointer+set}" = set; then :
 else
 
 case $target_os in
-linux* | gnu* | darwin[8912]*)
+linux* | gnu* | darwin[8912]* | cygwin* | mingw*)
   # Enable -fomit-frame-pointer by default for these systems with DWARF2.
   enable_frame_pointer=no
   ;;
diff --git a/gcc/configure.ac b/gcc/configure.ac
index bfcdf526e446..264f36fb78a8 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1884,7 +1884,7 @@ AC_ARG_ENABLE(frame-pointer,
 		[enable -fno-omit-frame-pointer by default for x86])], [],
 [
 case $target_os in
-linux* | gnu* | darwin[[8912]]*)
+linux* | gnu* | darwin[[8912]]* | cygwin* | mingw*)
   # Enable -fomit-frame-pointer by default for these systems with DWARF2.
   enable_frame_pointer=no
   ;;

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-05-13 10:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-08 12:25 [PATCH, i386]: Fix PR89221, --enable-frame-pointer does not work as intended Uros Bizjak
2019-02-10 19:52 ` [PATCH v2, " Uros Bizjak
2019-02-11  8:25   ` Rainer Orth
2019-05-06 15:00     ` Uros Bizjak
2019-05-09  9:55   ` [committed] [PR89221] Continue to default to '--disable-frame-pointer' for x86 GNU systems (was: [PATCH v2, i386]: Fix PR89221, --enable-frame-pointer does not work as intended) Thomas Schwinge
2019-05-13 10:16     ` [PATCH, i386]: --enable-frame-pointer for cygwin and mingw Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).