public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix bootstrap with ICL
@ 2014-07-09  4:02 Andi Kleen
  2014-07-09 17:17 ` Mike Stump
  0 siblings, 1 reply; 3+ messages in thread
From: Andi Kleen @ 2014-07-09  4:02 UTC (permalink / raw)
  To: gcc-patches


[I couldn't find a patch submission address for ICL, so I'm sending this
here]

With ICL enabled and an LTO boot strap the ICL build always errors
out due to -Werror=maybe-undefined. The following patch fixes
the LTO build for me by initializing the variables in question. 

All warnings were false positives as far as I can tell.

diff -u isl-0.12.2/isl_map_simplify.c-o isl-0.12.2/isl_map_simplify.c
--- isl-0.12.2/isl_map_simplify.c-o	2014-07-08 08:14:40.770984188 -0700
+++ isl-0.12.2/isl_map_simplify.c	2014-07-08 08:15:32.370982573 -0700
@@ -3004,7 +3004,7 @@
 
 	for (i = 0; i < bmap->n_div; ++i) {
 		int pos, neg;
-		int last_pos, last_neg;
+		int last_pos = 0, last_neg = 0;
 		int redundant;
 		int defined;
 
diff -u isl-0.12.2/isl_ast.c-o isl-0.12.2/isl_ast.c
--- isl-0.12.2/isl_ast.c-o	2014-07-08 08:02:23.375007276 -0700
+++ isl-0.12.2/isl_ast.c	2014-07-08 08:03:25.403005334 -0700
@@ -170,6 +170,9 @@
 		break;
 	case isl_ast_expr_error:
 		dup = NULL;
+		break;
+	default:
+		return NULL;
 	}
 
 	if (!dup)
diff -u isl-0.12.2/basis_reduction_templ.c-o isl-0.12.2/basis_reduction_templ.c
--- isl-0.12.2/basis_reduction_templ.c-o	2014-07-08 08:13:05.178987181 -0700
+++ isl-0.12.2/basis_reduction_templ.c	2014-07-08 08:13:45.374985923 -0700
@@ -54,7 +54,7 @@
 	int i;
 	GBR_LP *lp = NULL;
 	GBR_type F_old, alpha, F_new;
-	int row;
+	int row = 0;
 	isl_int tmp;
 	struct isl_vec *b_tmp;
 	GBR_type *F = NULL;
diff -u isl-0.12.2/isl_tab.c-o isl-0.12.2/isl_tab.c
--- isl-0.12.2/isl_tab.c-o	2014-07-08 08:09:55.782993111 -0700
+++ isl-0.12.2/isl_tab.c	2014-07-08 08:11:45.694989670 -0700
@@ -2686,7 +2686,7 @@
 			n_marked++;
 	}
 	while (n_marked) {
-		struct isl_tab_var *var;
+		struct isl_tab_var *var = NULL;
 		int sgn;
 		for (i = tab->n_redundant; i < tab->n_row; ++i) {
 			var = isl_tab_var_from_row(tab, i);
@@ -2886,7 +2886,7 @@
 			n_marked++;
 	}
 	while (n_marked) {
-		struct isl_tab_var *var;
+		struct isl_tab_var *var = NULL;
 		int red;
 		for (i = tab->n_redundant; i < tab->n_row; ++i) {
 			var = isl_tab_var_from_row(tab, i);
diff -u isl-0.12.2/isl_sample.c-o isl-0.12.2/isl_sample.c
--- isl-0.12.2/isl_sample.c-o	2014-07-08 08:13:51.558985729 -0700
+++ isl-0.12.2/isl_sample.c	2014-07-08 08:14:26.446984637 -0700
@@ -1443,7 +1443,7 @@
 __isl_give isl_point *isl_set_sample_point(__isl_take isl_set *set)
 {
 	int i;
-	isl_point *pnt;
+	isl_point *pnt = NULL;
 
 	if (!set)
 		return NULL;
diff -u isl-0.12.2/isl_tab_pip.c-o isl-0.12.2/isl_tab_pip.c
--- isl-0.12.2/isl_tab_pip.c-o	2014-07-08 08:11:54.950989380 -0700
+++ isl-0.12.2/isl_tab_pip.c	2014-07-08 08:12:55.794987475 -0700
@@ -2156,7 +2156,7 @@
 	int split;
 	int row;
 	int best = -1;
-	int best_r;
+	int best_r = -1;
 
 	if (isl_tab_extend_cons(context_tab, 2) < 0)
 		return -1;

-- 
ak@linux.intel.com -- Speaking for myself only.

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

* Re: [PATCH] Fix bootstrap with ICL
  2014-07-09  4:02 [PATCH] Fix bootstrap with ICL Andi Kleen
@ 2014-07-09 17:17 ` Mike Stump
  2014-07-09 17:34   ` Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Stump @ 2014-07-09 17:17 UTC (permalink / raw)
  To: Andi Kleen; +Cc: gcc-patches

On Jul 8, 2014, at 9:01 PM, Andi Kleen <andi@firstfloor.org> wrote:
> With ICL enabled and an LTO boot strap the ICL build always errors
> out due to -Werror=maybe-undefined. The following patch fixes
> the LTO build for me by initializing the variables in question. 
> 
> All warnings were false positives as far as I can tell.

I know of at least one programmer that uses the intelligence in the compiler to catch coding bugs with these sorts of warnings (or at least, the non-lto version of  these warnings).

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

* Re: [PATCH] Fix bootstrap with ICL
  2014-07-09 17:17 ` Mike Stump
@ 2014-07-09 17:34   ` Andi Kleen
  0 siblings, 0 replies; 3+ messages in thread
From: Andi Kleen @ 2014-07-09 17:34 UTC (permalink / raw)
  To: Mike Stump; +Cc: Andi Kleen, gcc-patches

On Wed, Jul 09, 2014 at 10:17:01AM -0700, Mike Stump wrote:
> On Jul 8, 2014, at 9:01 PM, Andi Kleen <andi@firstfloor.org> wrote:
> > With ICL enabled and an LTO boot strap the ICL build always errors
> > out due to -Werror=maybe-undefined. The following patch fixes
> > the LTO build for me by initializing the variables in question. 
> > 
> > All warnings were false positives as far as I can tell.
> 
> I know of at least one programmer that uses the intelligence in the compiler to catch coding bugs with these sorts of warnings (or at least, the non-lto version of  these warnings).

I'm not saying they never catch bugs, just that they didn't catch any
in ICL (from my limited code review).

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

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

end of thread, other threads:[~2014-07-09 17:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-09  4:02 [PATCH] Fix bootstrap with ICL Andi Kleen
2014-07-09 17:17 ` Mike Stump
2014-07-09 17:34   ` Andi Kleen

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