public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH PR66638]Fix assertion failure by skip the case.
@ 2015-06-26 11:06 Bin Cheng
  2015-06-26 11:32 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Bin Cheng @ 2015-06-26 11:06 UTC (permalink / raw)
  To: gcc-patches

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

Hi,
This patch fixes GCC's profiled bootstrap failure.  As comment added by in
patch, it may still be possible to prove no overflow information for some
scev, unfortunately it's a rare case observed during GCC profiled bootstrap.
So for now I just skip it.

Is this OK?

Thanks,
bin

2015-06-26  Bin Cheng  <bin.cheng@arm.com>

	PR bootstrap/66638
	* tree-ssa-loop-niter.c (loop_exits_before_overflow): Skip if
	assertion failed.  Remove assertion itself.


[-- Attachment #2: pr66638.txt --]
[-- Type: text/plain, Size: 1042 bytes --]

Index: gcc/tree-ssa-loop-niter.c
===================================================================
--- gcc/tree-ssa-loop-niter.c	(revision 224827)
+++ gcc/tree-ssa-loop-niter.c	(working copy)
@@ -3955,7 +3955,21 @@ loop_exits_before_overflow (tree base, tree step,
 	if (!CONVERT_EXPR_P (e) || !operand_equal_p (e, unsigned_base, 0))
 	  continue;
 	e = TREE_OPERAND (e, 0);
-	gcc_assert (operand_equal_p (e, base, 0));
+	/* It may still be possible to prove no overflow even if condition
+	   "operand_equal_p (e, base, 0)" isn't satisfied here, like below
+	   example:
+
+	     e             : ssa_var                 ; unsigned long type
+	     base          : (int) ssa_var
+	     unsigned_base : (unsigned int) ssa_var
+
+	   Unfortunately this is a rare case observed during GCC profiled
+	   bootstrap.  See PR66638 for more information.
+
+	   For now, we just skip the possibility.  */
+	if (!operand_equal_p (e, base, 0))
+	  continue;
+
 	if (tree_int_cst_sign_bit (step))
 	  {
 	    code = LT_EXPR;

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

* Re: [PATCH PR66638]Fix assertion failure by skip the case.
  2015-06-26 11:06 [PATCH PR66638]Fix assertion failure by skip the case Bin Cheng
@ 2015-06-26 11:32 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2015-06-26 11:32 UTC (permalink / raw)
  To: Bin Cheng; +Cc: GCC Patches

On Fri, Jun 26, 2015 at 1:03 PM, Bin Cheng <bin.cheng@arm.com> wrote:
> Hi,
> This patch fixes GCC's profiled bootstrap failure.  As comment added by in
> patch, it may still be possible to prove no overflow information for some
> scev, unfortunately it's a rare case observed during GCC profiled bootstrap.
> So for now I just skip it.
>
> Is this OK?

Ok.

Thanks,
Richard.

> Thanks,
> bin
>
> 2015-06-26  Bin Cheng  <bin.cheng@arm.com>
>
>         PR bootstrap/66638
>         * tree-ssa-loop-niter.c (loop_exits_before_overflow): Skip if
>         assertion failed.  Remove assertion itself.
>

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

end of thread, other threads:[~2015-06-26 11:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-26 11:06 [PATCH PR66638]Fix assertion failure by skip the case Bin Cheng
2015-06-26 11:32 ` 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).