[Bug target/69888] ICE: SIGSEGV in decide_alg (i386.c:26169) due to infinite (?) recursion with -minline-all-stringops -mmemset-strategy=no_stringop:-1:noalign

2017-12-07 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69888

Jeffrey A. Law  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 CC||law at redhat dot com
 Resolution|--- |FIXED

--- Comment #10 from Jeffrey A. Law  ---
Per c#9.

[Bug target/69888] ICE: SIGSEGV in decide_alg (i386.c:26169) due to infinite (?) recursion with -minline-all-stringops -mmemset-strategy=no_stringop:-1:noalign

2017-10-18 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69888

--- Comment #9 from Zdenek Sojka  ---
I think this bug can be closed now: it was fixed for gcc 6+ and gcc 5.4+.

[Bug target/69888] ICE: SIGSEGV in decide_alg (i386.c:26169) due to infinite (?) recursion with -minline-all-stringops -mmemset-strategy=no_stringop:-1:noalign

2016-03-30 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69888

--- Comment #8 from Jakub Jelinek  ---
Fixed for 5.4+ too.

[Bug target/69888] ICE: SIGSEGV in decide_alg (i386.c:26169) due to infinite (?) recursion with -minline-all-stringops -mmemset-strategy=no_stringop:-1:noalign

2016-03-30 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69888

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Wed Mar 30 12:39:20 2016
New Revision: 234560

URL: https://gcc.gnu.org/viewcvs?rev=234560=gcc=rev
Log:
Backported from mainline
2016-03-04  Jakub Jelinek  

PR target/70062
* config/i386/i386.c (decide_alg): Add RECUR argument.  Revert
2016-02-22 changes, instead don't recurse if RECUR is already true.
Don't change *dynamic_check if RECUR.  Adjust recursive caller
to pass true to the new argument.
(ix86_expand_set_or_movmem): Adjust decide_alg caller.

* gcc.target/i386/pr70062.c: New test.

2016-02-22  Jakub Jelinek  

PR target/69888
* config/i386/i386.c (decide_alg): Ensure we don't recurse with
identical arguments.  Formatting and spelling fixes.

* gcc.target/i386/pr69888.c: New test.

Added:
branches/gcc-5-branch/gcc/testsuite/gcc.target/i386/pr69888.c
branches/gcc-5-branch/gcc/testsuite/gcc.target/i386/pr70062.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/config/i386/i386.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog

[Bug target/69888] ICE: SIGSEGV in decide_alg (i386.c:26169) due to infinite (?) recursion with -minline-all-stringops -mmemset-strategy=no_stringop:-1:noalign

2016-02-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69888

Jakub Jelinek  changed:

   What|Removed |Added

  Known to work||6.0
  Known to fail|6.0 |

--- Comment #6 from Jakub Jelinek  ---
Fixed for 6+.

[Bug target/69888] ICE: SIGSEGV in decide_alg (i386.c:26169) due to infinite (?) recursion with -minline-all-stringops -mmemset-strategy=no_stringop:-1:noalign

2016-02-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69888

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Mon Feb 22 21:34:49 2016
New Revision: 233615

URL: https://gcc.gnu.org/viewcvs?rev=233615=gcc=rev
Log:
PR target/69888
* config/i386/i386.c (decide_alg): Ensure we don't recurse with
identical arguments.  Formatting and spelling fixes.

* gcc.target/i386/pr69888.c: New test.

Modified:
trunk/gcc/config/i386/i386.c

[Bug target/69888] ICE: SIGSEGV in decide_alg (i386.c:26169) due to infinite (?) recursion with -minline-all-stringops -mmemset-strategy=no_stringop:-1:noalign

2016-02-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69888

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Mon Feb 22 21:34:07 2016
New Revision: 233614

URL: https://gcc.gnu.org/viewcvs?rev=233614=gcc=rev
Log:
PR target/69888
* config/i386/i386.c (decide_alg): Ensure we don't recurse with
identical arguments.  Formatting and spelling fixes.

* gcc.target/i386/pr69888.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/i386/pr69888.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386.c
trunk/gcc/testsuite/ChangeLog

[Bug target/69888] ICE: SIGSEGV in decide_alg (i386.c:26169) due to infinite (?) recursion with -minline-all-stringops -mmemset-strategy=no_stringop:-1:noalign

2016-02-22 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69888

--- Comment #3 from Uroš Bizjak  ---
(In reply to Uroš Bizjak from comment #2)
> (In reply to Jakub Jelinek from comment #1)
> 
> > Untested fix.
> Looks OK, but please introduce a temporary variable, something like:
>
> +  HOST_WIDE_INT new_size;

HOST_WIDE_INT new_expected_size;

would be even better.

[Bug target/69888] ICE: SIGSEGV in decide_alg (i386.c:26169) due to infinite (?) recursion with -minline-all-stringops -mmemset-strategy=no_stringop:-1:noalign

2016-02-22 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69888

--- Comment #2 from Uroš Bizjak  ---
(In reply to Jakub Jelinek from comment #1)

> Untested fix.
Looks OK, but please introduce a temporary variable, something like:

--cut here--
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index a1c87ab..6457293 100644   
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -26152,20 +26152,23 @@ decide_alg (HOST_WIDE_INT count, HOST_WIDE_INT
expected_size,
  || !alg_usable_p (algs->unknown_size, memset, have_as)))
 {
   enum stringop_alg alg;
+  HOST_WIDE_INT new_size;

-  /* If there aren't any usable algorithms, then recursing on
- smaller sizes isn't going to find anything.  Just return the
- simple byte-at-a-time copy loop.  */
-  if (!any_alg_usable_p)
+  if (max <= 0)
+   max = 4096;
+  /* If there aren't any usable algorithms or if recursing with the
+same arguments as before, then recursing on smaller sizes or
+same size isn't going to find anything.  Just return the simple
+byte-at-a-time copy loop.  */
+  new_size = max / 2;
+  if (!any_alg_usable_p || new_size == orig_expected_size)
 {
   /* Pick something reasonable.  */
   if (TARGET_INLINE_STRINGOPS_DYNAMICALLY)
 *dynamic_check = 128;
   return loop_1_byte;
 }
-  if (max <= 0)
-   max = 4096;
-  alg = decide_alg (count, max / 2, min_size, max_size, memset,
+  alg = decide_alg (count, new_size, min_size, max_size, memset,
zero_memset, have_as, dynamic_check, noalign);
   gcc_assert (*dynamic_check == -1);
   if (TARGET_INLINE_STRINGOPS_DYNAMICALLY)
--cut here--

[Bug target/69888] ICE: SIGSEGV in decide_alg (i386.c:26169) due to infinite (?) recursion with -minline-all-stringops -mmemset-strategy=no_stringop:-1:noalign

2016-02-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69888

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-02-22
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
Created attachment 37751
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37751=edit
gcc6-pr69888.patch

Untested fix.