public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix warnings for profiledbootstrap (PR bootstrap/77788)
@ 2016-10-04  9:17 Martin Liška
  2016-10-05 16:41 ` Jeff Law
  2016-10-07  8:25 ` [PATCH] Fix profiled bootstrap (part 2) Martin Liška
  0 siblings, 2 replies; 3+ messages in thread
From: Martin Liška @ 2016-10-04  9:17 UTC (permalink / raw)
  To: GCC Patches; +Cc: Martin Sebor, Jakub Jelinek

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

Hello.

In the attached patch I resolve couple of warnings seen during make profiledbootstrap.
I can survive bootstrap on both ppc64le-redhat-linux and x86_64-linux-gnu targets.

Ready to be installed?
Martin

[-- Attachment #2: 0001-Fix-warnings-for-make-profiledbootstrap-PR-bootstrap.patch --]
[-- Type: text/x-patch, Size: 2846 bytes --]

From 510ac204f2e448d244c8eec5ab8aeab85f6041a9 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Mon, 3 Oct 2016 23:17:05 +0200
Subject: [PATCH] Fix warnings for make profiledbootstrap (PR bootstrap/77788)

gcc/ChangeLog:

2016-10-04  Martin Liska  <mliska@suse.cz>

	PR bootstrap/77788
	* expmed.h (mul_highpart_cost_ptr): Add an gcc_assert.
	* gimple-ssa-strength-reduction.c (slsr_process_cast):
	Initialize a pointer to NULL.
	(slsr_process_copy): Likewise.
	* input.c (location_get_source_line): Likewise.
	* tree-ssa-ccp.c (optimize_atomic_bit_test_and): Likewise.
---
 gcc/expmed.h                        | 4 +++-
 gcc/gimple-ssa-strength-reduction.c | 4 ++--
 gcc/input.c                         | 2 +-
 gcc/tree-ssa-ccp.c                  | 2 +-
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/gcc/expmed.h b/gcc/expmed.h
index cbceaf1..8d0af3c 100644
--- a/gcc/expmed.h
+++ b/gcc/expmed.h
@@ -618,8 +618,10 @@ static inline int *
 mul_highpart_cost_ptr (bool speed, machine_mode mode)
 {
   gcc_assert (GET_MODE_CLASS (mode) == MODE_INT);
+  int m = mode - MIN_MODE_INT;
+  gcc_assert (m < NUM_MODE_INT);
 
-  return &this_target_expmed->x_mul_highpart_cost[speed][mode - MIN_MODE_INT];
+  return &this_target_expmed->x_mul_highpart_cost[speed][m];
 }
 
 /* Set the COST for computing the high part of a multiplication in MODE
diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c
index b49637f..7b14b91 100644
--- a/gcc/gimple-ssa-strength-reduction.c
+++ b/gcc/gimple-ssa-strength-reduction.c
@@ -1529,7 +1529,7 @@ static void
 slsr_process_cast (gimple *gs, tree rhs1, bool speed)
 {
   tree lhs, ctype;
-  slsr_cand_t base_cand, c, c2;
+  slsr_cand_t base_cand, c = NULL, c2;
   unsigned savings = 0;
 
   if (!legal_cast_p (gs, rhs1))
@@ -1593,7 +1593,7 @@ slsr_process_cast (gimple *gs, tree rhs1, bool speed)
 static void
 slsr_process_copy (gimple *gs, tree rhs1, bool speed)
 {
-  slsr_cand_t base_cand, c, c2;
+  slsr_cand_t base_cand, c = NULL, c2;
   unsigned savings = 0;
 
   base_cand = base_cand_from_table (rhs1);
diff --git a/gcc/input.c b/gcc/input.c
index 67f727e..6131659 100644
--- a/gcc/input.c
+++ b/gcc/input.c
@@ -713,7 +713,7 @@ const char *
 location_get_source_line (const char *file_path, int line,
 			  int *line_len)
 {
-  char *buffer;
+  char *buffer = NULL;
   ssize_t len;
 
   if (line == 0)
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index b6ccb59..3dc9ffa 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -2817,7 +2817,7 @@ optimize_atomic_bit_test_and (gimple_stmt_iterator *gsip,
   FOR_EACH_IMM_USE_STMT (g, iter, use_lhs)
     {
       enum tree_code code = ERROR_MARK;
-      tree op0, op1;
+      tree op0 = NULL_TREE, op1 = NULL_TREE;
       if (is_gimple_debug (g))
 	{
 	  has_debug_uses = true;
-- 
2.9.2


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

* Re: [PATCH] Fix warnings for profiledbootstrap (PR bootstrap/77788)
  2016-10-04  9:17 [PATCH] Fix warnings for profiledbootstrap (PR bootstrap/77788) Martin Liška
@ 2016-10-05 16:41 ` Jeff Law
  2016-10-07  8:25 ` [PATCH] Fix profiled bootstrap (part 2) Martin Liška
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Law @ 2016-10-05 16:41 UTC (permalink / raw)
  To: Martin Liška, GCC Patches; +Cc: Martin Sebor, Jakub Jelinek

On 10/04/2016 03:16 AM, Martin Liška wrote:
> Hello.
>
> In the attached patch I resolve couple of warnings seen during make profiledbootstrap.
> I can survive bootstrap on both ppc64le-redhat-linux and x86_64-linux-gnu targets.
>
> Ready to be installed?
> Martin
>
>
> 0001-Fix-warnings-for-make-profiledbootstrap-PR-bootstrap.patch
>
>
> From 510ac204f2e448d244c8eec5ab8aeab85f6041a9 Mon Sep 17 00:00:00 2001
> From: marxin <mliska@suse.cz>
> Date: Mon, 3 Oct 2016 23:17:05 +0200
> Subject: [PATCH] Fix warnings for make profiledbootstrap (PR bootstrap/77788)
>
> gcc/ChangeLog:
>
> 2016-10-04  Martin Liska  <mliska@suse.cz>
>
> 	PR bootstrap/77788
> 	* expmed.h (mul_highpart_cost_ptr): Add an gcc_assert.
> 	* gimple-ssa-strength-reduction.c (slsr_process_cast):
> 	Initialize a pointer to NULL.
> 	(slsr_process_copy): Likewise.
> 	* input.c (location_get_source_line): Likewise.
> 	* tree-ssa-ccp.c (optimize_atomic_bit_test_and): Likewise.
Presumably what's going on here is that the profiling data is giving the 
jump threader additional information and the threader is refusing to 
thread some jumps because they're not profitable.  AT least that's how 
it looks to me.

Note the input.c change may not be necessary once the input.c cleanups 
are done, but I don't think it'd be actively harmful.

OK.

jeff

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

* [PATCH] Fix profiled bootstrap (part 2)
  2016-10-04  9:17 [PATCH] Fix warnings for profiledbootstrap (PR bootstrap/77788) Martin Liška
  2016-10-05 16:41 ` Jeff Law
@ 2016-10-07  8:25 ` Martin Liška
  1 sibling, 0 replies; 3+ messages in thread
From: Martin Liška @ 2016-10-07  8:25 UTC (permalink / raw)
  To: GCC Patches; +Cc: Martin Sebor, Jakub Jelinek

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

There's one more hunk needed to build profiledbootstrap.
Hope it's obvious, I'm going to install the patch.

Thanks,
Martin

[-- Attachment #2: 0001-Fix-profiled-bootstrap-part-2.patch --]
[-- Type: text/x-patch, Size: 716 bytes --]

From eab203805280062a2733ffcc758f5282a8163905 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Thu, 6 Oct 2016 19:33:39 +0200
Subject: [PATCH] Fix profiled bootstrap (part 2)

gcc/cp/ChangeLog:

2016-10-06  Martin Liska  <mliska@suse.cz>

	* lambda.c (maybe_add_lambda_conv_op): Set default value.
---
 gcc/cp/lambda.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index cd32226..d4284bf 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -967,7 +967,7 @@ maybe_add_lambda_conv_op (tree type)
   {
     int ix = 0;
     tree src = DECL_CHAIN (DECL_ARGUMENTS (callop));
-    tree tgt;
+    tree tgt = NULL;
 
     while (src)
       {
-- 
2.9.2


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

end of thread, other threads:[~2016-10-07  8:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-04  9:17 [PATCH] Fix warnings for profiledbootstrap (PR bootstrap/77788) Martin Liška
2016-10-05 16:41 ` Jeff Law
2016-10-07  8:25 ` [PATCH] Fix profiled bootstrap (part 2) 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).