public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Remove MPX support
@ 2018-04-27 11:28 Martin Liška
  2018-05-01 17:28 ` Jeff Law
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Martin Liška @ 2018-04-27 11:28 UTC (permalink / raw)
  To: GCC Patches; +Cc: Ilya Enkovich

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

Hi.

I'm sending patch that removes MPX. It preserves all options -fcheck-pointer-bounds, -fchkp-* and -mmpx
target option. These options are now NOP. On the contrary following options were removed:
--static-libmpx  -static-libmpxwrappers. Is it fine to remove them?

Patch can bootstrap on x86_64-linux-gnu, ppc64le-linux-gnu and survives regression tests.
And the patch bootstraps also on aarch64-linux-gnu.

Note that the patch is trim for files (some) that are removed. Doing that was necessary to
fit in 100K with bzip2 patch file.

Ready to be installed after some time?
Martin

[-- Attachment #2: 0001-Remove-MPX-without-removed-v2.patch.bz2 --]
[-- Type: application/x-bzip, Size: 81803 bytes --]

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

* Re: [PATCH] Remove MPX support
  2018-04-27 11:28 [PATCH] Remove MPX support Martin Liška
@ 2018-05-01 17:28 ` Jeff Law
  2018-05-30 18:47   ` Jakub Jelinek
  2018-06-08 11:09 ` [PATCH] Come up with Deprecated option flag Martin Liška
  2018-06-08 11:10 ` [PATCH] Use flags_from_decl_or_type in lto_symtab_merge_p (PR ipa/85248) Martin Liška
  2 siblings, 1 reply; 12+ messages in thread
From: Jeff Law @ 2018-05-01 17:28 UTC (permalink / raw)
  To: Martin Liška, GCC Patches; +Cc: Ilya Enkovich

On 04/27/2018 05:00 AM, Martin Liška wrote:
> Hi.
> 
> I'm sending patch that removes MPX. It preserves all options -fcheck-pointer-bounds, -fchkp-* and -mmpx
> target option. These options are now NOP. On the contrary following options were removed:
> --static-libmpx  -static-libmpxwrappers. Is it fine to remove them?
> 
> Patch can bootstrap on x86_64-linux-gnu, ppc64le-linux-gnu and survives regression tests.
> And the patch bootstraps also on aarch64-linux-gnu.
> 
> Note that the patch is trim for files (some) that are removed. Doing that was necessary to
> fit in 100K with bzip2 patch file.
> 
> Ready to be installed after some time?
Yes.  Please coordinate with Jakub & Richi since this touches a fair
amount of code and might interfere with attempts to backport changes
from the trunk into the gcc-8 release branch.

I wouldn't be surprised if we find bits of MPX code after the patch is
installed.  Changes to remove any stragglers are pre-approved as well.

Jeff

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

* Re: [PATCH] Remove MPX support
  2018-05-01 17:28 ` Jeff Law
@ 2018-05-30 18:47   ` Jakub Jelinek
  2018-05-31 12:23     ` Martin Liška
  0 siblings, 1 reply; 12+ messages in thread
From: Jakub Jelinek @ 2018-05-30 18:47 UTC (permalink / raw)
  To: Martin Liška, Jeff Law; +Cc: gcc-patches

On Tue, May 01, 2018 at 11:28:13AM -0600, Jeff Law wrote:
> On 04/27/2018 05:00 AM, Martin Liška wrote:
> > I'm sending patch that removes MPX. It preserves all options -fcheck-pointer-bounds, -fchkp-* and -mmpx
> > target option. These options are now NOP. On the contrary following options were removed:
> > --static-libmpx  -static-libmpxwrappers. Is it fine to remove them?
> > 
> > Patch can bootstrap on x86_64-linux-gnu, ppc64le-linux-gnu and survives regression tests.
> > And the patch bootstraps also on aarch64-linux-gnu.
> > 
> > Note that the patch is trim for files (some) that are removed. Doing that was necessary to
> > fit in 100K with bzip2 patch file.
> > 
> > Ready to be installed after some time?
> Yes.  Please coordinate with Jakub & Richi since this touches a fair
> amount of code and might interfere with attempts to backport changes
> from the trunk into the gcc-8 release branch.
> 
> I wouldn't be surprised if we find bits of MPX code after the patch is
> installed.  Changes to remove any stragglers are pre-approved as well.

Martin, any progress with this?  I'm not worried about MPX removal making
backports much harder.

	Jakub

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

* Re: [PATCH] Remove MPX support
  2018-05-30 18:47   ` Jakub Jelinek
@ 2018-05-31 12:23     ` Martin Liška
  0 siblings, 0 replies; 12+ messages in thread
From: Martin Liška @ 2018-05-31 12:23 UTC (permalink / raw)
  To: Jakub Jelinek, Jeff Law; +Cc: gcc-patches, Jan Hubicka

On 05/30/2018 07:40 PM, Jakub Jelinek wrote:
> On Tue, May 01, 2018 at 11:28:13AM -0600, Jeff Law wrote:
>> On 04/27/2018 05:00 AM, Martin Liška wrote:
>>> I'm sending patch that removes MPX. It preserves all options -fcheck-pointer-bounds, -fchkp-* and -mmpx
>>> target option. These options are now NOP. On the contrary following options were removed:
>>> --static-libmpx  -static-libmpxwrappers. Is it fine to remove them?
>>>
>>> Patch can bootstrap on x86_64-linux-gnu, ppc64le-linux-gnu and survives regression tests.
>>> And the patch bootstraps also on aarch64-linux-gnu.
>>>
>>> Note that the patch is trim for files (some) that are removed. Doing that was necessary to
>>> fit in 100K with bzip2 patch file.
>>>
>>> Ready to be installed after some time?
>> Yes.  Please coordinate with Jakub & Richi since this touches a fair
>> amount of code and might interfere with attempts to backport changes
>> from the trunk into the gcc-8 release branch.
>>
>> I wouldn't be surprised if we find bits of MPX code after the patch is
>> installed.  Changes to remove any stragglers are pre-approved as well.
> 
> Martin, any progress with this?  I'm not worried about MPX removal making
> backports much harder.
> 
> 	Jakub
> 
Hi.

I did agreement with Richi that Honza will make review of IPA and i386 related parts.
And Richi will then review general changes. Honza is aware of the review request
and work on that soon.

Martin

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

* [PATCH] Come up with Deprecated option flag.
  2018-04-27 11:28 [PATCH] Remove MPX support Martin Liška
  2018-05-01 17:28 ` Jeff Law
@ 2018-06-08 11:09 ` Martin Liška
  2018-06-11 19:19   ` Jeff Law
  2018-06-11 19:34   ` Paul Koning
  2018-06-08 11:10 ` [PATCH] Use flags_from_decl_or_type in lto_symtab_merge_p (PR ipa/85248) Martin Liška
  2 siblings, 2 replies; 12+ messages in thread
From: Martin Liška @ 2018-06-08 11:09 UTC (permalink / raw)
  To: GCC Patches; +Cc: Ilya Enkovich, Richard Biener, Jan Hubička

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

Hi.

First follow-up MPX removal patch comes up with Deprecated option flag.
That prints warning for options that have no effect:

$ ./xgcc -B. /tmp/main.c -Wchkp -static-libmpxwrappers
xgcc: warning: deprecated command line option ‘-static-libmpxwrappers’
cc1: warning: deprecated command line option ‘-Wchkp’

Is the string OK, or?

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Martin

[-- Attachment #2: 0001-Come-up-with-Deprecated-option-flag.patch --]
[-- Type: text/x-patch, Size: 9987 bytes --]

From 0b1473e517373386e674c6736de5007960138d03 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Fri, 8 Jun 2018 10:52:23 +0200
Subject: [PATCH] Come up with Deprecated option flag.

gcc/ChangeLog:

2018-06-08  Martin Liska  <mliska@suse.cz>

	* config/i386/i386.opt: Make MPX-related options as Deprecated.
	* opt-functions.awk: Handle Deprecated flag.
	* opts-common.c (decode_cmdline_option): Handle cl_deprecated
        and report error.
	(read_cmdline_option): Report warning for a deprecated option.
	* opts.h (struct cl_option): Add new field cl_deprecated.
	(CL_ERR_DEPRECATED): New.

gcc/c-family/ChangeLog:

2018-06-08  Martin Liska  <mliska@suse.cz>

	* c.opt: Make MPX-related options as Deprecated.

gcc/testsuite/ChangeLog:

2018-06-08  Martin Liska  <mliska@suse.cz>

	* g++.dg/opt/mpx.C: New test.
	* gcc.target/i386/mpx.c: New test.
---
 gcc/c-family/c.opt                  | 42 ++++++++++++++---------------
 gcc/config/i386/i386.opt            |  2 +-
 gcc/opt-functions.awk               |  3 ++-
 gcc/opts-common.c                   | 10 +++++++
 gcc/opts.h                          |  3 +++
 gcc/testsuite/g++.dg/opt/mpx.C      |  5 ++++
 gcc/testsuite/gcc.target/i386/mpx.c |  3 +++
 7 files changed, 45 insertions(+), 23 deletions(-)
 create mode 100644 gcc/testsuite/g++.dg/opt/mpx.C
 create mode 100644 gcc/testsuite/gcc.target/i386/mpx.c

diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 1d7eafff1f7..b4aefd8d5f6 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -409,7 +409,7 @@ C ObjC C++ ObjC++ Var(warn_char_subscripts) Warning LangEnabledBy(C ObjC C++ Obj
 Warn about subscripts whose type is \"char\".
 
 Wchkp
-C ObjC C++ ObjC++ Var(warn_chkp) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
+C ObjC C++ ObjC++ Var(warn_chkp) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 Wclobbered
@@ -1259,86 +1259,86 @@ C ObjC C++ ObjC++
 Where shorter, use canonicalized paths to systems headers.
 
 fcheck-pointer-bounds
-C ObjC C++ ObjC++ LTO Report Var(flag_check_pointer_bounds)
+C ObjC C++ ObjC++ LTO Report Var(flag_check_pointer_bounds) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 fchkp-check-incomplete-type
-C ObjC C++ ObjC++ LTO Report Var(flag_chkp_incomplete_type) Init(1)
+C ObjC C++ ObjC++ LTO Report Var(flag_chkp_incomplete_type) Init(1) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 fchkp-zero-input-bounds-for-main
-C ObjC C++ ObjC++ LTO Report Var(flag_chkp_zero_input_bounds_for_main) Init(0)
+C ObjC C++ ObjC++ LTO Report Var(flag_chkp_zero_input_bounds_for_main) Init(0) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 fchkp-first-field-has-own-bounds
-C ObjC C++ ObjC++ LTO RejectNegative Report Var(flag_chkp_first_field_has_own_bounds)
+C ObjC C++ ObjC++ LTO RejectNegative Report Var(flag_chkp_first_field_has_own_bounds) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 fchkp-narrow-bounds
-C ObjC C++ ObjC++ LTO Report Var(flag_chkp_narrow_bounds) Init(1)
+C ObjC C++ ObjC++ LTO Report Var(flag_chkp_narrow_bounds) Init(1) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 fchkp-narrow-to-innermost-array
-C ObjC C++ ObjC++ LTO RejectNegative Report Var(flag_chkp_narrow_to_innermost_arrray)
+C ObjC C++ ObjC++ LTO RejectNegative Report Var(flag_chkp_narrow_to_innermost_arrray) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 fchkp-flexible-struct-trailing-arrays
-C ObjC C++ ObjC++ LTO Report Var(flag_chkp_flexible_struct_trailing_arrays)
+C ObjC C++ ObjC++ LTO Report Var(flag_chkp_flexible_struct_trailing_arrays) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 fchkp-optimize
 C ObjC C++ ObjC++ LTO Report Var(flag_chkp_optimize) Init(-1)
 
 fchkp-use-fast-string-functions
-C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_fast_string_functions) Init(0)
+C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_fast_string_functions) Init(0) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 fchkp-use-nochk-string-functions
-C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_nochk_string_functions) Init(0)
+C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_nochk_string_functions) Init(0) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 fchkp-use-static-bounds
-C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_static_bounds) Init(1)
+C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_static_bounds) Init(1) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 fchkp-use-static-const-bounds
-C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_static_const_bounds) Init(-1)
+C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_static_const_bounds) Init(-1) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 fchkp-treat-zero-dynamic-size-as-infinite
-C ObjC C++ ObjC++ LTO Report Var(flag_chkp_zero_dynamic_size_as_infinite) Init(0)
+C ObjC C++ ObjC++ LTO Report Var(flag_chkp_zero_dynamic_size_as_infinite) Init(0) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 fchkp-check-read
-C ObjC C++ ObjC++ LTO Report Var(flag_chkp_check_read) Init(1)
+C ObjC C++ ObjC++ LTO Report Var(flag_chkp_check_read) Init(1) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 fchkp-check-write
-C ObjC C++ ObjC++ LTO Report Var(flag_chkp_check_write) Init(1)
+C ObjC C++ ObjC++ LTO Report Var(flag_chkp_check_write) Init(1) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 fchkp-store-bounds
-C ObjC C++ ObjC++ LTO Report Var(flag_chkp_store_bounds) Init(1)
+C ObjC C++ ObjC++ LTO Report Var(flag_chkp_store_bounds) Init(1) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 fchkp-instrument-calls
-C ObjC C++ ObjC++ LTO Report Var(flag_chkp_instrument_calls) Init(1)
+C ObjC C++ ObjC++ LTO Report Var(flag_chkp_instrument_calls) Init(1) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 fchkp-instrument-marked-only
-C ObjC C++ ObjC++ LTO Report Var(flag_chkp_instrument_marked_only) Init(0)
+C ObjC C++ ObjC++ LTO Report Var(flag_chkp_instrument_marked_only) Init(0) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 fchkp-use-wrappers
-C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_wrappers) Init(1)
+C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_wrappers) Init(1) Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 static-libmpx
-Driver
+Driver Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 static-libmpxwrappers
-Driver
+Driver Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 fcilkplus Undocumented
diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt
index 01a0385dfa4..a34d4acf1a2 100644
--- a/gcc/config/i386/i386.opt
+++ b/gcc/config/i386/i386.opt
@@ -951,7 +951,7 @@ Target Report Mask(ISA_RTM) Var(ix86_isa_flags) Save
 Support RTM built-in functions and code generation.
 
 mmpx
-Target Report
+Target Report Deprecated
 Deprecated in GCC 9.  This switch has no effect.
 
 mmwaitx
diff --git a/gcc/opt-functions.awk b/gcc/opt-functions.awk
index 819a9629ab9..2c371e5a23a 100644
--- a/gcc/opt-functions.awk
+++ b/gcc/opt-functions.awk
@@ -136,7 +136,8 @@ function switch_bit_fields (flags)
 	  flag_init("UInteger", flags) \
 	  flag_init("Host_Wide_Int", hwi) \
 	  flag_init("ToLower", flags) \
-	  flag_init("Report", flags)
+	  flag_init("Report", flags) \
+	  flag_init("Deprecated", flags)
 
 	sub(", $", "", result)
 	return result
diff --git a/gcc/opts-common.c b/gcc/opts-common.c
index c6b94188b40..004da73e614 100644
--- a/gcc/opts-common.c
+++ b/gcc/opts-common.c
@@ -667,6 +667,10 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
   if (!option_ok_for_language (option, lang_mask))
     errors |= CL_ERR_WRONG_LANG;
 
+  /* Mark all deprecated options.  */
+  if (option->cl_deprecated)
+    errors |= CL_ERR_DEPRECATED;
+
   /* Convert the argument to lowercase if appropriate.  */
   if (arg && option->cl_tolower)
     {
@@ -1250,6 +1254,12 @@ read_cmdline_option (struct gcc_options *opts,
       return;
     }
 
+  if (decoded->errors & CL_ERR_DEPRECATED)
+    {
+      warning_at (loc, 0, "deprecated command line option %qs", opt);
+      return;
+    }
+
   gcc_assert (!decoded->errors);
 
   if (!handle_option (opts, opts_set, decoded, lang_mask, DK_UNSPECIFIED,
diff --git a/gcc/opts.h b/gcc/opts.h
index 484fc1c39d9..3c4065eae92 100644
--- a/gcc/opts.h
+++ b/gcc/opts.h
@@ -100,6 +100,8 @@ struct cl_option
   BOOL_BITFIELD cl_tolower : 1;
   /* Report argument with -fverbose-asm  */
   BOOL_BITFIELD cl_report : 1;
+  /* Deprecated option  */
+  BOOL_BITFIELD cl_deprecated: 1;
   /* Offset of field for this option in struct gcc_options, or
      (unsigned short) -1 if none.  */
   unsigned short flag_var_offset;
@@ -209,6 +211,7 @@ extern const unsigned int cl_enums_count;
 #define CL_ERR_NEGATIVE		(1 << 6) /* Negative form of option
 					    not permitted (together
 					    with OPT_SPECIAL_unknown).  */
+#define CL_ERR_DEPRECATED	(1 << 7) /* Deprecated option.  */
 
 /* Structure describing the result of decoding an option.  */
 
diff --git a/gcc/testsuite/g++.dg/opt/mpx.C b/gcc/testsuite/g++.dg/opt/mpx.C
new file mode 100644
index 00000000000..6ae0cef8790
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/mpx.C
@@ -0,0 +1,5 @@
+// { dg-do compile }
+// { dg-options "-fcheck-pointer-bounds -fchkp-first-field-has-own-bounds" }
+
+// { dg-warning "deprecated command line option .-fcheck-pointer-bounds." "" { target *-*-* } 0 }
+// { dg-warning "deprecated command line option .-fchkp-first-field-has-own-bounds." "" { target *-*-* } 0 }
diff --git a/gcc/testsuite/gcc.target/i386/mpx.c b/gcc/testsuite/gcc.target/i386/mpx.c
new file mode 100644
index 00000000000..f152ae94ecb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx.c
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+// { dg-options "-mmpx" }
+// { dg-warning "deprecated command line option .-mmpx." "" { target *-*-* } 0 }
-- 
2.17.0


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

* [PATCH] Use flags_from_decl_or_type in lto_symtab_merge_p (PR ipa/85248).
  2018-04-27 11:28 [PATCH] Remove MPX support Martin Liška
  2018-05-01 17:28 ` Jeff Law
  2018-06-08 11:09 ` [PATCH] Come up with Deprecated option flag Martin Liška
@ 2018-06-08 11:10 ` Martin Liška
  2018-06-13 11:22   ` Richard Biener
  2 siblings, 1 reply; 12+ messages in thread
From: Martin Liška @ 2018-06-08 11:10 UTC (permalink / raw)
  To: GCC Patches; +Cc: Ilya Enkovich, Richard Biener

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

Hi.

Second follow-up patch uses flags_from_decl_or_type in LTO merging
of declarations. Hope it's more cleaner approach.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Martin

[-- Attachment #2: 0001-Use-flags_from_decl_or_type-in-lto_symtab_merge_p-PR.patch --]
[-- Type: text/x-patch, Size: 3221 bytes --]

From 17d598f028c723cb11e8a9f786e3026c0cfca4aa Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Fri, 8 Jun 2018 10:14:47 +0200
Subject: [PATCH] Use flags_from_decl_or_type in lto_symtab_merge_p (PR
 ipa/85248).

gcc/lto/ChangeLog:

2018-06-08  Martin Liska  <mliska@suse.cz>

        PR ipa/85248
	* lto-symtab.c (lto_symtab_merge_p): Use
        flags_from_decl_or_type.
---
 gcc/lto/lto-symtab.c | 50 +++++++++++++-------------------------------
 1 file changed, 15 insertions(+), 35 deletions(-)

diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c
index b1df9bb77d1..2259358ea5f 100644
--- a/gcc/lto/lto-symtab.c
+++ b/gcc/lto/lto-symtab.c
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "lto-symtab.h"
 #include "stringpool.h"
 #include "attribs.h"
+#include "calls.h"
 
 /* Replace the cgraph node NODE with PREVAILING_NODE in the cgraph, merging
    all edges and removing the old node.  */
@@ -547,7 +548,7 @@ lto_symtab_merge_p (tree prevailing, tree decl)
     {
       if (DECL_BUILT_IN (prevailing) != DECL_BUILT_IN (decl))
 	{
-          if (symtab->dump_file)
+	  if (symtab->dump_file)
 	    fprintf (symtab->dump_file, "Not merging decls; "
 		     "DECL_BUILT_IN mismatch\n");
 	  return false;
@@ -561,44 +562,23 @@ lto_symtab_merge_p (tree prevailing, tree decl)
 		     "DECL_BUILT_IN_CLASS or CODE mismatch\n");
 	  return false;
 	}
-    }
 
-  /* FIXME: after MPX is removed, use flags_from_decl_or_type
-     function instead.  PR lto/85248.  */
-  if (DECL_ATTRIBUTES (prevailing) != DECL_ATTRIBUTES (decl))
-    {
-      tree prev_attr = lookup_attribute ("error", DECL_ATTRIBUTES (prevailing));
-      tree attr = lookup_attribute ("error", DECL_ATTRIBUTES (decl));
-      if ((prev_attr == NULL) != (attr == NULL)
-	  || (prev_attr && !attribute_value_equal (prev_attr, attr)))
+      if (DECL_ATTRIBUTES (prevailing) != DECL_ATTRIBUTES (decl))
 	{
-          if (symtab->dump_file)
-	    fprintf (symtab->dump_file, "Not merging decls; "
-		     "error attribute mismatch\n");
-	  return false;
-	}
-
-      prev_attr = lookup_attribute ("warning", DECL_ATTRIBUTES (prevailing));
-      attr = lookup_attribute ("warning", DECL_ATTRIBUTES (decl));
-      if ((prev_attr == NULL) != (attr == NULL)
-	  || (prev_attr && !attribute_value_equal (prev_attr, attr)))
-	{
-          if (symtab->dump_file)
-	    fprintf (symtab->dump_file, "Not merging decls; "
-		     "warning attribute mismatch\n");
-	  return false;
-	}
-
-      prev_attr = lookup_attribute ("noreturn", DECL_ATTRIBUTES (prevailing));
-      attr = lookup_attribute ("noreturn", DECL_ATTRIBUTES (decl));
-      if ((prev_attr == NULL) != (attr == NULL))
-	{
-          if (symtab->dump_file)
-	    fprintf (symtab->dump_file, "Not merging decls; "
-		     "noreturn attribute mismatch\n");
-	  return false;
+	  int prev_decl_attrs
+	    = flags_from_decl_or_type (prevailing);
+	  int decl_attrs
+	    = flags_from_decl_or_type (decl);
+	  if (prev_decl_attrs != decl_attrs)
+	    {
+	      if (symtab->dump_file)
+		fprintf (symtab->dump_file, "Not merging decls; "
+			 "DECL_ATTRIBUTES mismatch\n");
+	      return false;
+	    }
 	}
     }
+
   return true;
 }
 
-- 
2.17.0


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

* Re: [PATCH] Come up with Deprecated option flag.
  2018-06-08 11:09 ` [PATCH] Come up with Deprecated option flag Martin Liška
@ 2018-06-11 19:19   ` Jeff Law
  2018-06-11 19:34   ` Paul Koning
  1 sibling, 0 replies; 12+ messages in thread
From: Jeff Law @ 2018-06-11 19:19 UTC (permalink / raw)
  To: Martin Liška, GCC Patches
  Cc: Ilya Enkovich, Richard Biener, Jan Hubička

On 06/08/2018 05:09 AM, Martin Liška wrote:
> Hi.
> 
> First follow-up MPX removal patch comes up with Deprecated option flag.
> That prints warning for options that have no effect:
> 
> $ ./xgcc -B. /tmp/main.c -Wchkp -static-libmpxwrappers
> xgcc: warning: deprecated command line option ‘-static-libmpxwrappers’
> cc1: warning: deprecated command line option ‘-Wchkp’
> 
> Is the string OK, or?
> 
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> 
> Ready to be installed?
> Martin
> 
> 
> 0001-Come-up-with-Deprecated-option-flag.patch
> 
> 
> From 0b1473e517373386e674c6736de5007960138d03 Mon Sep 17 00:00:00 2001
> From: marxin <mliska@suse.cz>
> Date: Fri, 8 Jun 2018 10:52:23 +0200
> Subject: [PATCH] Come up with Deprecated option flag.
> 
> gcc/ChangeLog:
> 
> 2018-06-08  Martin Liska  <mliska@suse.cz>
> 
> 	* config/i386/i386.opt: Make MPX-related options as Deprecated.
> 	* opt-functions.awk: Handle Deprecated flag.
> 	* opts-common.c (decode_cmdline_option): Handle cl_deprecated
>         and report error.
> 	(read_cmdline_option): Report warning for a deprecated option.
> 	* opts.h (struct cl_option): Add new field cl_deprecated.
> 	(CL_ERR_DEPRECATED): New.
> 
> gcc/c-family/ChangeLog:
> 
> 2018-06-08  Martin Liska  <mliska@suse.cz>
> 
> 	* c.opt: Make MPX-related options as Deprecated.
> 
> gcc/testsuite/ChangeLog:
> 
> 2018-06-08  Martin Liska  <mliska@suse.cz>
> 
> 	* g++.dg/opt/mpx.C: New test.
> 	* gcc.target/i386/mpx.c: New test.
OK.
jeff

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

* Re: [PATCH] Come up with Deprecated option flag.
  2018-06-08 11:09 ` [PATCH] Come up with Deprecated option flag Martin Liška
  2018-06-11 19:19   ` Jeff Law
@ 2018-06-11 19:34   ` Paul Koning
  2018-06-12 14:22     ` Martin Liška
  1 sibling, 1 reply; 12+ messages in thread
From: Paul Koning @ 2018-06-11 19:34 UTC (permalink / raw)
  To: Martin Liška; +Cc: GCC Patches



> On Jun 8, 2018, at 7:09 AM, Martin Liška <mliska@suse.cz> wrote:
> 
> Hi.
> 
> First follow-up MPX removal patch comes up with Deprecated option flag.
> That prints warning for options that have no effect:

Should this be mentioned in the internals manual (section 8.2)?

	paul

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

* Re: [PATCH] Come up with Deprecated option flag.
  2018-06-11 19:34   ` Paul Koning
@ 2018-06-12 14:22     ` Martin Liška
  0 siblings, 0 replies; 12+ messages in thread
From: Martin Liška @ 2018-06-12 14:22 UTC (permalink / raw)
  To: Paul Koning; +Cc: GCC Patches

On 06/11/2018 09:33 PM, Paul Koning wrote:
> 
> 
>> On Jun 8, 2018, at 7:09 AM, Martin Liška <mliska@suse.cz> wrote:
>>
>> Hi.
>>
>> First follow-up MPX removal patch comes up with Deprecated option flag.
>> That prints warning for options that have no effect:
> 
> Should this be mentioned in the internals manual (section 8.2)?
> 
> 	paul
> 

Thanks for noticing that.
Done and installed as r261497.

Martin

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

* Re: [PATCH] Use flags_from_decl_or_type in lto_symtab_merge_p (PR ipa/85248).
  2018-06-08 11:10 ` [PATCH] Use flags_from_decl_or_type in lto_symtab_merge_p (PR ipa/85248) Martin Liška
@ 2018-06-13 11:22   ` Richard Biener
  2018-06-20  8:05     ` Martin Liška
  0 siblings, 1 reply; 12+ messages in thread
From: Richard Biener @ 2018-06-13 11:22 UTC (permalink / raw)
  To: mliska; +Cc: GCC Patches, Ilya Enkovich

On Fri, Jun 8, 2018 at 1:10 PM Martin Liška <mliska@suse.cz> wrote:
>
> Hi.
>
> Second follow-up patch uses flags_from_decl_or_type in LTO merging
> of declarations. Hope it's more cleaner approach.
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed?

That doesn't handle the "error" attribute case anymore?

We also have attribute_list_equal / attribute_list_contained that could be
used here?

Richard.

> Martin

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

* Re: [PATCH] Use flags_from_decl_or_type in lto_symtab_merge_p (PR ipa/85248).
  2018-06-13 11:22   ` Richard Biener
@ 2018-06-20  8:05     ` Martin Liška
  2018-06-20  8:35       ` Richard Biener
  0 siblings, 1 reply; 12+ messages in thread
From: Martin Liška @ 2018-06-20  8:05 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches, Ilya Enkovich

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

On 06/13/2018 01:21 PM, Richard Biener wrote:
> On Fri, Jun 8, 2018 at 1:10 PM Martin Liška <mliska@suse.cz> wrote:
>>
>> Hi.
>>
>> Second follow-up patch uses flags_from_decl_or_type in LTO merging
>> of declarations. Hope it's more cleaner approach.
>>
>> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>>
>> Ready to be installed?
> 
> That doesn't handle the "error" attribute case anymore?
> 
> We also have attribute_list_equal / attribute_list_contained that could be
> used here?

You are right, it can't work. Thus I would erase the FIXME comment.

Is it fine?
Martin

> 
> Richard.
> 
>> Martin


[-- Attachment #2: 0001-Remove-not-longer-valid-FIXME-comment.patch --]
[-- Type: text/x-patch, Size: 904 bytes --]

From a9c0185ec343aa9064f5166645651e603a2b8538 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Wed, 20 Jun 2018 10:01:48 +0200
Subject: [PATCH] Remove not longer valid FIXME comment.

gcc/lto/ChangeLog:

2018-06-20  Martin Liska  <mliska@suse.cz>

	* lto-symtab.c (lto_symtab_merge_p): Remove not valid
        FIXME comment.
---
 gcc/lto/lto-symtab.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c
index a40ba1f32ef..0d603c0281f 100644
--- a/gcc/lto/lto-symtab.c
+++ b/gcc/lto/lto-symtab.c
@@ -564,8 +564,6 @@ lto_symtab_merge_p (tree prevailing, tree decl)
 	}
     }
 
-  /* FIXME: after MPX is removed, use flags_from_decl_or_type
-     function instead.  PR lto/85248.  */
   if (DECL_ATTRIBUTES (prevailing) != DECL_ATTRIBUTES (decl))
     {
       tree prev_attr = lookup_attribute ("error", DECL_ATTRIBUTES (prevailing));
-- 
2.17.1


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

* Re: [PATCH] Use flags_from_decl_or_type in lto_symtab_merge_p (PR ipa/85248).
  2018-06-20  8:05     ` Martin Liška
@ 2018-06-20  8:35       ` Richard Biener
  0 siblings, 0 replies; 12+ messages in thread
From: Richard Biener @ 2018-06-20  8:35 UTC (permalink / raw)
  To: mliska; +Cc: GCC Patches, Ilya Enkovich

On Wed, Jun 20, 2018 at 10:03 AM Martin Liška <mliska@suse.cz> wrote:
>
> On 06/13/2018 01:21 PM, Richard Biener wrote:
> > On Fri, Jun 8, 2018 at 1:10 PM Martin Liška <mliska@suse.cz> wrote:
> >>
> >> Hi.
> >>
> >> Second follow-up patch uses flags_from_decl_or_type in LTO merging
> >> of declarations. Hope it's more cleaner approach.
> >>
> >> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> >>
> >> Ready to be installed?
> >
> > That doesn't handle the "error" attribute case anymore?
> >
> > We also have attribute_list_equal / attribute_list_contained that could be
> > used here?
>
> You are right, it can't work. Thus I would erase the FIXME comment.
>
> Is it fine?

Ok.

Richard.

> Martin
>
> >
> > Richard.
> >
> >> Martin
>

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

end of thread, other threads:[~2018-06-20  8:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-27 11:28 [PATCH] Remove MPX support Martin Liška
2018-05-01 17:28 ` Jeff Law
2018-05-30 18:47   ` Jakub Jelinek
2018-05-31 12:23     ` Martin Liška
2018-06-08 11:09 ` [PATCH] Come up with Deprecated option flag Martin Liška
2018-06-11 19:19   ` Jeff Law
2018-06-11 19:34   ` Paul Koning
2018-06-12 14:22     ` Martin Liška
2018-06-08 11:10 ` [PATCH] Use flags_from_decl_or_type in lto_symtab_merge_p (PR ipa/85248) Martin Liška
2018-06-13 11:22   ` Richard Biener
2018-06-20  8:05     ` Martin Liška
2018-06-20  8:35       ` Richard Biener

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).