public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC 7 backport
@ 2018-06-29  9:45 Martin Liška
  2018-08-16 10:18 ` Martin Liška
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Liška @ 2018-06-29  9:45 UTC (permalink / raw)
  To: GCC Patches

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

Hi.

I'm going to install following tested patch (it's already in GCC-6 branch).

Martin

[-- Attachment #2: 0001-Partial-backport-r256656.patch --]
[-- Type: text/x-patch, Size: 1140 bytes --]

From 46584361c5f48925395e8155e6a9b809507a25be Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 15 Jun 2018 08:51:28 +0000
Subject: [PATCH] Partial backport r256656

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

	Backport from mainline
	2018-01-10  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	* lex.c (search_line_fast): Remove illegal coercion of an
	unaligned pointer value to vector pointer type and replace with
	use of __builtin_vec_vsx_ld () built-in function, which operates
	on unaligned pointer values.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@261621 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libcpp/lex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcpp/lex.c b/libcpp/lex.c
index 097c78002cb..e0fb9e822c4 100644
--- a/libcpp/lex.c
+++ b/libcpp/lex.c
@@ -568,7 +568,7 @@ search_line_fast (const uchar *s, const uchar *end ATTRIBUTE_UNUSED)
     {
       vc m_nl, m_cr, m_bs, m_qm;
 
-      data = *((const vc *)s);
+      data = __builtin_vec_vsx_ld (0, s);
       s += 16;
 
       m_nl = (vc) __builtin_vec_cmpeq(data, repl_nl);
-- 
2.17.1


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

* Re: GCC 7 backport
  2018-06-29  9:45 GCC 7 backport Martin Liška
@ 2018-08-16 10:18 ` Martin Liška
  2019-02-15 10:58   ` Martin Liška
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Liška @ 2018-08-16 10:18 UTC (permalink / raw)
  To: GCC Patches

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

Hi.

I'm going to install one more patch.

Martin

[-- Attachment #2: 0001-patch-263246.patch --]
[-- Type: text/x-patch, Size: 1086 bytes --]

From 1a1934d31636a8bd72a6d93143dbe216ff6e6ad4 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 2 Aug 2018 09:32:58 +0000
Subject: Backport r263246

libsanitizer/ChangeLog:

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

        PR sanitizer/86022
	* sanitizer_common/sanitizer_linux_libcdep.cc (ThreadDescriptorSize):
        Cherry-pick compiler-rt revision 338606.

---
diff --git a/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc b/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
index d27a8435802..3b1a2174c46 100644
--- a/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
+++ b/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
@@ -235,7 +235,7 @@ uptr ThreadDescriptorSize() {
         val = FIRST_32_SECOND_64(1168, 1776);
       else if (minor == 11 || (minor == 12 && patch == 1))
         val = FIRST_32_SECOND_64(1168, 2288);
-      else if (minor <= 13)
+      else if (minor <= 14)
         val = FIRST_32_SECOND_64(1168, 2304);
       else
         val = FIRST_32_SECOND_64(1216, 2304);
--
2.18.0

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

* Re: GCC 7 backport
  2018-08-16 10:18 ` Martin Liška
@ 2019-02-15 10:58   ` Martin Liška
  2019-03-11 11:23     ` Martin Liška
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Liška @ 2019-02-15 10:58 UTC (permalink / raw)
  To: GCC Patches

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

On 8/16/18 12:18 PM, Martin Liška wrote:
> Hi.
> 
> I'm going to install one more patch.
> 
> Martin
> 

Hi.

I'm going to install another 2 patches.

Thanks,
Martin

[-- Attachment #2: 0001-Backport-r268762.patch --]
[-- Type: text/x-patch, Size: 5416 bytes --]

From 37023f6a8e122d325cf3e3a054511425550cb6d6 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Fri, 15 Feb 2019 11:00:42 +0100
Subject: [PATCH 1/2] Backport r268762

gcc/ChangeLog:

2019-02-11  Martin Liska  <mliska@suse.cz>

	PR ipa/89009
	* ipa-cp.c (build_toporder_info): Remove usage of a param.
	* ipa-inline.c (inline_small_functions): Likewise.
	* ipa-pure-const.c (propagate_pure_const): Likewise.
	(propagate_nothrow): Likewise.
	* ipa-reference.c (propagate): Likewise.
	* ipa-utils.c (struct searchc_env): Remove unused field.
	(searchc): Always search across AVAIL_INTERPOSABLE.
	(ipa_reduced_postorder): Always allow AVAIL_INTERPOSABLE as
	the only called IPA pure const can properly not propagate
	across interposable boundary.
	* ipa-utils.h (ipa_reduced_postorder): Remove param.

gcc/testsuite/ChangeLog:

2019-02-11  Martin Liska  <mliska@suse.cz>

	PR ipa/89009
	* g++.dg/ipa/pr89009.C: New test.
---
 gcc/ipa-cp.c         | 2 +-
 gcc/ipa-inline.c     | 2 +-
 gcc/ipa-pure-const.c | 4 ++--
 gcc/ipa-reference.c  | 2 +-
 gcc/ipa-utils.c      | 9 +++------
 gcc/ipa-utils.h      | 2 +-
 6 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 3902d3a8a00..b42cfb0f6e0 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -810,7 +810,7 @@ build_toporder_info (struct ipa_topo_info *topo)
   topo->stack = XCNEWVEC (struct cgraph_node *, symtab->cgraph_count);
 
   gcc_checking_assert (topo->stack_top == 0);
-  topo->nnodes = ipa_reduced_postorder (topo->order, true, true, NULL);
+  topo->nnodes = ipa_reduced_postorder (topo->order, true, NULL);
 }
 
 /* Free information about strongly connected components and the arrays in
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 0c25635f4c8..b520c6393f4 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -1745,7 +1745,7 @@ inline_small_functions (void)
      metrics.  */
 
   max_count = 0;
-  ipa_reduced_postorder (order, true, true, NULL);
+  ipa_reduced_postorder (order, true, NULL);
   free (order);
 
   FOR_EACH_DEFINED_FUNCTION (node)
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index e457166ea39..5a11919dd5c 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -1233,7 +1233,7 @@ propagate_pure_const (void)
   bool remove_p = false;
   bool has_cdtor;
 
-  order_pos = ipa_reduced_postorder (order, true, false,
+  order_pos = ipa_reduced_postorder (order, true,
 				     ignore_edge_for_pure_const);
   if (dump_file)
     {
@@ -1566,7 +1566,7 @@ propagate_nothrow (void)
   int i;
   struct ipa_dfs_info * w_info;
 
-  order_pos = ipa_reduced_postorder (order, true, false,
+  order_pos = ipa_reduced_postorder (order, true,
 				     ignore_edge_for_nothrow);
   if (dump_file)
     {
diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c
index f47d0cc51e1..ccbfa078deb 100644
--- a/gcc/ipa-reference.c
+++ b/gcc/ipa-reference.c
@@ -730,7 +730,7 @@ propagate (void)
      the global information.  All the nodes within a cycle will have
      the same info so we collapse cycles first.  Then we can do the
      propagation in one pass from the leaves to the roots.  */
-  order_pos = ipa_reduced_postorder (order, true, true, ignore_edge_p);
+  order_pos = ipa_reduced_postorder (order, true, ignore_edge_p);
   if (dump_file)
     ipa_print_order (dump_file, "reduced", order, order_pos);
 
diff --git a/gcc/ipa-utils.c b/gcc/ipa-utils.c
index f7dd29f925c..3fb02150904 100644
--- a/gcc/ipa-utils.c
+++ b/gcc/ipa-utils.c
@@ -63,7 +63,6 @@ struct searchc_env {
   int order_pos;
   splay_tree nodes_marked_new;
   bool reduce;
-  bool allow_overwritable;
   int count;
 };
 
@@ -105,7 +104,7 @@ searchc (struct searchc_env* env, struct cgraph_node *v,
 
       if (w->aux
 	  && (avail > AVAIL_INTERPOSABLE
-	      || (env->allow_overwritable && avail == AVAIL_INTERPOSABLE)))
+	      || avail == AVAIL_INTERPOSABLE))
 	{
 	  w_info = (struct ipa_dfs_info *) w->aux;
 	  if (w_info->new_node)
@@ -162,7 +161,7 @@ searchc (struct searchc_env* env, struct cgraph_node *v,
 
 int
 ipa_reduced_postorder (struct cgraph_node **order,
-		       bool reduce, bool allow_overwritable,
+		       bool reduce,
 		       bool (*ignore_edge) (struct cgraph_edge *))
 {
   struct cgraph_node *node;
@@ -175,15 +174,13 @@ ipa_reduced_postorder (struct cgraph_node **order,
   env.nodes_marked_new = splay_tree_new (splay_tree_compare_ints, 0, 0);
   env.count = 1;
   env.reduce = reduce;
-  env.allow_overwritable = allow_overwritable;
 
   FOR_EACH_DEFINED_FUNCTION (node)
     {
       enum availability avail = node->get_availability ();
 
       if (avail > AVAIL_INTERPOSABLE
-	  || (allow_overwritable
-	      && (avail == AVAIL_INTERPOSABLE)))
+	  || avail == AVAIL_INTERPOSABLE)
 	{
 	  /* Reuse the info if it is already there.  */
 	  struct ipa_dfs_info *info = (struct ipa_dfs_info *) node->aux;
diff --git a/gcc/ipa-utils.h b/gcc/ipa-utils.h
index e992f65948b..f8a25a6786f 100644
--- a/gcc/ipa-utils.h
+++ b/gcc/ipa-utils.h
@@ -36,7 +36,7 @@ struct ipa_dfs_info {
 
 /* In ipa-utils.c  */
 void ipa_print_order (FILE*, const char *, struct cgraph_node**, int);
-int ipa_reduced_postorder (struct cgraph_node **, bool, bool,
+int ipa_reduced_postorder (struct cgraph_node **, bool,
 			  bool (*ignore_edge) (struct cgraph_edge *));
 void ipa_free_postorder_info (void);
 vec<cgraph_node *> ipa_get_nodes_in_cycle (struct cgraph_node *);
-- 
2.20.1


[-- Attachment #3: 0002-Backport-r268873.patch --]
[-- Type: text/x-patch, Size: 923 bytes --]

From be2787931281d79cfff01dc19e3449b302cdcfcd Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Thu, 14 Feb 2019 14:25:48 +0100
Subject: [PATCH 2/2] Backport r268873

gcc/ChangeLog:

2019-02-14  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/89242
	* dce.c (delete_unmarked_insns): Call free_dominance_info we
	process a transformation.

gcc/testsuite/ChangeLog:

2019-02-14  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/89242
	* g++.dg/pr89242.C: New test.
---
 gcc/dce.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/dce.c b/gcc/dce.c
index 91e2f2768a3..0c7874d4f2a 100644
--- a/gcc/dce.c
+++ b/gcc/dce.c
@@ -635,7 +635,10 @@ delete_unmarked_insns (void)
 
   /* Deleted a pure or const call.  */
   if (must_clean)
-    delete_unreachable_blocks ();
+    {
+      delete_unreachable_blocks ();
+      free_dominance_info (CDI_DOMINATORS);
+    }
 }
 
 
-- 
2.20.1


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

* Re: GCC 7 backport
  2019-02-15 10:58   ` Martin Liška
@ 2019-03-11 11:23     ` Martin Liška
  2019-03-28  8:56       ` Martin Liška
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Liška @ 2019-03-11 11:23 UTC (permalink / raw)
  To: GCC Patches

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

Hi.

Another 2 patches that I've just tested.

Thanks,
Martin

[-- Attachment #2: 0002-Backport-r268981.patch --]
[-- Type: text/x-patch, Size: 1126 bytes --]

From a4ec4d12444bc2fed3fbf559d6cae4618caab7c8 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 18 Feb 2019 09:46:19 +0000
Subject: [PATCH 2/2] Backport r268981

libcpp/ChangeLog:

2019-02-18  Martin Liska  <mliska@suse.cz>

	PR c++/89383
	* line-map.c (linemap_line_start): Use 1UL in order
	to not overflow.
---
 libcpp/line-map.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libcpp/line-map.c b/libcpp/line-map.c
index 5827f303b6d..ddcb0111f4b 100644
--- a/libcpp/line-map.c
+++ b/libcpp/line-map.c
@@ -756,7 +756,8 @@ linemap_line_start (struct line_maps *set, linenum_type to_line,
 	  || ( /* We can't reuse the map if the line offset is sufficiently
 		  large to cause overflow when computing location_t values.  */
 	      (to_line - ORDINARY_MAP_STARTING_LINE_NUMBER (map))
-	      >= (1U << (CHAR_BIT * sizeof (linenum_type) - column_bits)))
+	      >= (((uint64_t) 1)
+		  << (CHAR_BIT * sizeof (linenum_type) - column_bits)))
 	  || range_bits < map->m_range_bits)
 	map = linemap_check_ordinary
 	        (const_cast <line_map *>
-- 
2.21.0


[-- Attachment #3: 0001-Backport-r268789.patch --]
[-- Type: text/x-patch, Size: 3133 bytes --]

From c4a45a0f56b8eb91295260332989382180418506 Mon Sep 17 00:00:00 2001
From: dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 12 Feb 2019 01:09:31 +0000
Subject: [PATCH 1/2] Backport r268789

gcc/ChangeLog:

2019-02-11  David Malcolm  <dmalcolm@redhat.com>

	PR lto/88147
	* input.c (selftest::test_line_offset_overflow): New selftest.
	(selftest::input_c_tests): Call it.

libcpp/ChangeLog:

2019-02-11  Martin Liska  <mliska@suse.cz>

	PR lto/88147
	* line-map.c (linemap_line_start): Don't reuse the existing line
	map if the line offset is sufficiently large to cause overflow
	when computing location_t values.
---
 gcc/input.c       | 30 ++++++++++++++++++++++++++++++
 libcpp/line-map.c |  4 ++++
 2 files changed, 34 insertions(+)

diff --git a/gcc/input.c b/gcc/input.c
index 80718100d0c..6412d70f4e2 100644
--- a/gcc/input.c
+++ b/gcc/input.c
@@ -3480,6 +3480,34 @@ for_each_line_table_case (void (*testcase) (const line_table_case &))
   ASSERT_EQ (num_cases_tested, 2 * 12);
 }
 
+/* Verify that when presented with a consecutive pair of locations with
+   a very large line offset, we don't attempt to consolidate them into
+   a single ordinary linemap where the line offsets within the line map
+   would lead to overflow (PR lto/88147).  */
+
+static void
+test_line_offset_overflow ()
+{
+  line_table_test ltt (line_table_case (5, 0));
+
+  linemap_add (line_table, LC_ENTER, false, "foo.c", 0);
+  linemap_line_start (line_table, 1, 100);
+  location_t loc_a = linemap_line_start (line_table, 2578, 255);
+  assert_loceq ("foo.c", 2578, 0, loc_a);
+
+  const line_map_ordinary *ordmap_a = LINEMAPS_LAST_ORDINARY_MAP (line_table);
+  ASSERT_EQ (ordmap_a->m_column_and_range_bits, 13);
+  ASSERT_EQ (ordmap_a->m_range_bits, 5);
+
+  location_t loc_b = linemap_line_start (line_table, 404198, 512);
+  assert_loceq ("foo.c", 404198, 0, loc_b);
+
+  /* We should have started a new linemap, rather than attempting to store
+     a very large line offset.  */
+  const line_map_ordinary *ordmap_b = LINEMAPS_LAST_ORDINARY_MAP (line_table);
+  ASSERT_NE (ordmap_a, ordmap_b);
+}
+
 /* Run all of the selftests within this file.  */
 
 void
@@ -3518,6 +3546,8 @@ input_c_tests ()
   for_each_line_table_case (test_lexer_char_constants);
 
   test_reading_source_line ();
+
+  test_line_offset_overflow ();
 }
 
 } // namespace selftest
diff --git a/libcpp/line-map.c b/libcpp/line-map.c
index 949489eb1a1..5827f303b6d 100644
--- a/libcpp/line-map.c
+++ b/libcpp/line-map.c
@@ -753,6 +753,10 @@ linemap_line_start (struct line_maps *set, linenum_type to_line,
       if (line_delta < 0
 	  || last_line != ORDINARY_MAP_STARTING_LINE_NUMBER (map)
 	  || SOURCE_COLUMN (map, highest) >= (1U << (column_bits - range_bits))
+	  || ( /* We can't reuse the map if the line offset is sufficiently
+		  large to cause overflow when computing location_t values.  */
+	      (to_line - ORDINARY_MAP_STARTING_LINE_NUMBER (map))
+	      >= (1U << (CHAR_BIT * sizeof (linenum_type) - column_bits)))
 	  || range_bits < map->m_range_bits)
 	map = linemap_check_ordinary
 	        (const_cast <line_map *>
-- 
2.21.0


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

* Re: GCC 7 backport
  2019-03-11 11:23     ` Martin Liška
@ 2019-03-28  8:56       ` Martin Liška
  2019-04-11  9:00         ` Martin Liška
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Liška @ 2019-03-28  8:56 UTC (permalink / raw)
  To: GCC Patches

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

Hi.

Backporting one documentation fix.

Martin

[-- Attachment #2: 0001-Backport-r265786.patch --]
[-- Type: text/x-patch, Size: 1063 bytes --]

From 7bcca48f559a3fefaf37b177b3c72e78d73d73ba Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Thu, 28 Mar 2019 09:51:06 +0100
Subject: [PATCH] Backport r265786

gcc/ChangeLog:

2018-11-05  Martin Liska  <mliska@suse.cz>

	PR web/87829
	* doc/invoke.texi: Remove options that are
	not disabled with -Os.
---
 gcc/doc/invoke.texi | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index a41d275e89d..8f279e454b0 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -7140,8 +7140,7 @@ do not typically increase code size.
 
 @option{-Os} disables the following optimization flags:
 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
--falign-labels  -freorder-blocks  -freorder-blocks-algorithm=stc @gol
--freorder-blocks-and-partition  -fprefetch-loop-arrays}
+-falign-labels  -fprefetch-loop-arrays}
 
 It also enables @option{-finline-functions}, causes the compiler to tune for
 code size rather than execution speed, and performs further optimizations
-- 
2.21.0


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

* Re: GCC 7 backport
  2019-03-28  8:56       ` Martin Liška
@ 2019-04-11  9:00         ` Martin Liška
  2019-05-28 11:58           ` Martin Liška
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Liška @ 2019-04-11  9:00 UTC (permalink / raw)
  To: GCC Patches

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

On 3/28/19 9:52 AM, Martin Liška wrote:
> Hi.
> 
> Backporting one documentation fix.
> 
> Martin
> 

One more patch that I'm going to backport.

Martin

[-- Attachment #2: 0001-Backport-r269492.patch --]
[-- Type: text/x-patch, Size: 4222 bytes --]

From a096ce6d9f8e636815af5a237881e1ba443f1b18 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 8 Mar 2019 12:55:40 +0000
Subject: [PATCH] Backport r269492

gcc/ChangeLog:

2019-03-08  Martin Liska  <mliska@suse.cz>

	PR target/86952
	* config/i386/i386.c (ix86_option_override_internal): Disable
	jump tables when retpolines are used.

gcc/testsuite/ChangeLog:

2019-03-08  Martin Liska  <mliska@suse.cz>

	PR target/86952
	* gcc.target/i386/pr86952.c: New test.
	* gcc.target/i386/indirect-thunk-7.c: Use jump tables to match
	scanned pattern.
	* gcc.target/i386/indirect-thunk-inline-7.c: Likewise.
---
 gcc/config/i386/i386.c                        |  6 +++++
 .../gcc.target/i386/indirect-thunk-7.c        |  2 +-
 .../gcc.target/i386/indirect-thunk-extern-7.c |  2 +-
 .../gcc.target/i386/indirect-thunk-inline-7.c |  2 +-
 gcc/testsuite/gcc.target/i386/pr86952.c       | 23 +++++++++++++++++++
 5 files changed, 32 insertions(+), 3 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/i386/pr86952.c

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 18dce38640b..96bdb3a78ba 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -6282,6 +6282,12 @@ ix86_option_override_internal (bool main_args_p,
     target_option_default_node = target_option_current_node
       = build_target_option_node (opts);
 
+  /* PR86952: jump table usage with retpolines is slow.
+     The PR provides some numbers about the slowness.  */
+  if (ix86_indirect_branch != indirect_branch_keep
+      && !opts_set->x_flag_jump_tables)
+    opts->x_flag_jump_tables = 0;
+
   return true;
 }
 
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c
index 3c72036dbaf..53868f46558 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic -fjump-tables" } */
 
 void func0 (void);
 void func1 (void);
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c
index 2b9a33e93dc..bc185fe98af 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic -fjump-tables" } */
 
 void func0 (void);
 void func1 (void);
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c
index ea009245a58..e6f064959a1 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic -fjump-tables" } */
 
 void func0 (void);
 void func1 (void);
diff --git a/gcc/testsuite/gcc.target/i386/pr86952.c b/gcc/testsuite/gcc.target/i386/pr86952.c
new file mode 100644
index 00000000000..004e167add0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr86952.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mindirect-branch=thunk" } */
+
+int global;
+
+int
+foo (int x)
+{
+  switch (x & 7)
+    {
+      case 0: ; return 1722;
+      case 1: global += 1; return 1060;
+      case 2: ; return 1990;
+      case 3: ; return 1242;
+      case 4: ; return 1466;
+      case 5: ; return 894;
+      case 6: ; return 570;
+      case 7: ; return 572;
+      default: return 0;
+    }
+}
+
+/* { dg-final { scan-assembler-not "jmp\[ \t\]\\*" } } */
-- 
2.21.0


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

* Re: GCC 7 backport
  2019-04-11  9:00         ` Martin Liška
@ 2019-05-28 11:58           ` Martin Liška
  2019-07-22 11:05             ` Martin Liška
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Liška @ 2019-05-28 11:58 UTC (permalink / raw)
  To: GCC Patches

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

Hi.

There are 3 backports that touch g++.dg/ipa/pr89009.C test-case.

Thanks,
Martin

[-- Attachment #2: 0003-Backport-r270476.patch --]
[-- Type: text/x-patch, Size: 834 bytes --]

From 32fea51fa1294abb7c2aface7fc302406ff182cd Mon Sep 17 00:00:00 2001
From: sandra <sandra@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sun, 21 Apr 2019 02:01:36 +0000
Subject: [PATCH 3/3] Backport r270476

gcc/testsuite/ChangeLog:

2019-04-20  Sandra Loosemore  <sandra@codesourcery.com>

	* g++.dg/ipa/pr89009.C: Add dg-require-effective-target fpic.
---
 gcc/testsuite/g++.dg/ipa/pr89009.C | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/testsuite/g++.dg/ipa/pr89009.C b/gcc/testsuite/g++.dg/ipa/pr89009.C
index 70ab0be64a9..ec181d0e8ce 100644
--- a/gcc/testsuite/g++.dg/ipa/pr89009.C
+++ b/gcc/testsuite/g++.dg/ipa/pr89009.C
@@ -1,5 +1,6 @@
 /* PR ipa/89009 */
 /* { dg-do run } */
+/* { dg-require-effective-target fpic } */
 /* { dg-options "-fpic -O2 -fno-inline" } */
 /* { dg-require-visibility "" } */
 
-- 
2.21.0


[-- Attachment #3: 0002-Backport-r269278.patch --]
[-- Type: text/x-patch, Size: 1145 bytes --]

From 600f32adacd444162e61796a73f0058a55474356 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 28 Feb 2019 13:17:09 +0000
Subject: [PATCH 2/3] Backport r269278

gcc/testsuite/ChangeLog:

2019-02-28  John David Anglin  <danglin@gcc.gnu.org>

	PR testsuite/89441
	* g++.dg/ipa/pr89009.C: Update symbol visibility.
---
 gcc/testsuite/g++.dg/ipa/pr89009.C | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/g++.dg/ipa/pr89009.C b/gcc/testsuite/g++.dg/ipa/pr89009.C
index 6b4fc65a641..70ab0be64a9 100644
--- a/gcc/testsuite/g++.dg/ipa/pr89009.C
+++ b/gcc/testsuite/g++.dg/ipa/pr89009.C
@@ -1,11 +1,12 @@
 /* PR ipa/89009 */
 /* { dg-do run } */
-/* { dg-options "-fvisibility=hidden -fpic -O2 -fno-inline" } */
+/* { dg-options "-fpic -O2 -fno-inline" } */
+/* { dg-require-visibility "" } */
 
-#pragma GCC visibility push(default)
 void foo1() { __builtin_printf ("foo\n"); }
-#pragma GCC visibility pop
+#pragma GCC visibility push(hidden)
 void foo2() { __builtin_printf ("foo\n"); }
+#pragma GCC visibility pop
 
 int main() { foo2(); return 0; }
 
-- 
2.21.0


[-- Attachment #4: 0001-Backport-r268762-test-suite.patch --]
[-- Type: text/x-patch, Size: 1038 bytes --]

From 1d6ee7c522281ceed467f5a5f2278b67b4313369 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 11 Feb 2019 08:13:03 +0000
Subject: [PATCH 1/3] Backport r268762 (test-suite)

gcc/testsuite/ChangeLog:

2019-02-11  Martin Liska  <mliska@suse.cz>

	PR ipa/89009
	* g++.dg/ipa/pr89009.C: New test.
---
 gcc/testsuite/g++.dg/ipa/pr89009.C | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/ipa/pr89009.C

diff --git a/gcc/testsuite/g++.dg/ipa/pr89009.C b/gcc/testsuite/g++.dg/ipa/pr89009.C
new file mode 100644
index 00000000000..6b4fc65a641
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/pr89009.C
@@ -0,0 +1,12 @@
+/* PR ipa/89009 */
+/* { dg-do run } */
+/* { dg-options "-fvisibility=hidden -fpic -O2 -fno-inline" } */
+
+#pragma GCC visibility push(default)
+void foo1() { __builtin_printf ("foo\n"); }
+#pragma GCC visibility pop
+void foo2() { __builtin_printf ("foo\n"); }
+
+int main() { foo2(); return 0; }
+
+/* { dg-output "foo" } */
-- 
2.21.0


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

* Re: GCC 7 backport
  2019-05-28 11:58           ` Martin Liška
@ 2019-07-22 11:05             ` Martin Liška
  0 siblings, 0 replies; 8+ messages in thread
From: Martin Liška @ 2019-07-22 11:05 UTC (permalink / raw)
  To: gcc-patches

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

Hi.

One more patch I've just tested.

Martin

[-- Attachment #2: 0001-Backport-r273660.patch --]
[-- Type: text/x-patch, Size: 2755 bytes --]

From eb62ef9ec1edc109aa69137ed077620cafad5253 Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Mon, 22 Jul 2019 10:00:07 +0200
Subject: [PATCH] Backport r273660

gcc/ChangeLog:

2019-07-22  Martin Liska  <mliska@suse.cz>

	PR driver/91172
	* opts-common.c (decode_cmdline_option): Decode
	argument of -Werror and check it for a wrong language.
	* opts-global.c (complain_wrong_lang): Remove such case.

gcc/testsuite/ChangeLog:

2019-07-22  Martin Liska  <mliska@suse.cz>

	PR driver/91172
	* gcc.dg/pr91172.c: New test.
---
 gcc/opts-common.c | 20 +++++++++++++++++++-
 gcc/opts-global.c |  6 +++++-
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/gcc/opts-common.c b/gcc/opts-common.c
index 3c2553368ac..9b0d76d1148 100644
--- a/gcc/opts-common.c
+++ b/gcc/opts-common.c
@@ -438,7 +438,8 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
 
   extra_args = 0;
 
-  opt_index = find_opt (argv[0] + 1, lang_mask);
+  const char *opt_value = argv[0] + 1;
+  opt_index = find_opt (opt_value, lang_mask);
   i = 0;
   while (opt_index == OPT_SPECIAL_unknown
 	 && i < ARRAY_SIZE (option_map))
@@ -641,6 +642,23 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
   /* Check if this is a switch for a different front end.  */
   if (!option_ok_for_language (option, lang_mask))
     errors |= CL_ERR_WRONG_LANG;
+  else if (strcmp (option->opt_text, "-Werror=") == 0
+	   && strchr (opt_value, ',') == NULL)
+    {
+      /* Verify that -Werror argument is a valid warning
+	 for a language.  */
+      char *werror_arg = xstrdup (opt_value + 6);
+      werror_arg[0] = 'W';
+
+      size_t warning_index = find_opt (werror_arg, lang_mask);
+      if (warning_index != OPT_SPECIAL_unknown)
+	{
+	  const struct cl_option *warning_option
+	    = &cl_options[warning_index];
+	  if (!option_ok_for_language (warning_option, lang_mask))
+	    errors |= CL_ERR_WRONG_LANG;
+	}
+    }
 
   /* Convert the argument to lowercase if appropriate.  */
   if (arg && option->cl_tolower)
diff --git a/gcc/opts-global.c b/gcc/opts-global.c
index bfa2afb1987..b45d18996a3 100644
--- a/gcc/opts-global.c
+++ b/gcc/opts-global.c
@@ -100,10 +100,14 @@ complain_wrong_lang (const struct cl_decoded_option *decoded,
 	   text, bad_lang);
   else if (lang_mask == CL_DRIVER)
     gcc_unreachable ();
-  else
+  else if (ok_langs[0] != '\0')
     /* Eventually this should become a hard error IMO.  */
     warning (0, "command line option %qs is valid for %s but not for %s",
 	     text, ok_langs, bad_lang);
+  else
+    /* Happens for -Werror=warning_name.  */
+    warning (0, "%<-Werror=%> argument %qs is not valid for %s",
+	     text, bad_lang);
 
   free (ok_langs);
   free (bad_lang);
-- 
2.22.0


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

end of thread, other threads:[~2019-07-22  9:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-29  9:45 GCC 7 backport Martin Liška
2018-08-16 10:18 ` Martin Liška
2019-02-15 10:58   ` Martin Liška
2019-03-11 11:23     ` Martin Liška
2019-03-28  8:56       ` Martin Liška
2019-04-11  9:00         ` Martin Liška
2019-05-28 11:58           ` Martin Liška
2019-07-22 11:05             ` Martin Liška

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