[Bug other/91048] New: Recent changes to contrib/mklog cause failure

2019-07-01 Thread kelvin.nilsen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91048

Bug ID: 91048
   Summary: Recent changes to contrib/mklog cause failure
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: kelvin.nilsen at gmail dot com
  Target Milestone: ---

./contrib/mklog crashes, even on very simple diff files.  Sample traceback
report follows:

./contrib/mklog svn.diffs.7-1-2019 >svn.ChangeLog
Traceback (most recent call last):
 File “./contrib/mklog”, line 470, in 
   main()
 File “./contrib/mklog”, line 357, in main
   name, email = read_user_info()
 File “./contrib/mklog”, line 105, in read_user_info
   if cache.match(r’^\s*([a-zA-Z0-9_]+)\s*=\s*(.*?)\s*$’, s):
 File “./contrib/mklog”, line 57, in match
   self.last_match = re.match(p, s) if isinstance(p, str) else p.match(s)
 File “/usr/lib/python3.5/re.py”, line 163, in match
   return _compile(pattern, flags).match(string)
TypeError: cannot use a string pattern on a bytes-like object

I get these problems with any diff file.  In this case, my diff file consists
only of the following:

kelvin@genoa:~/gcc-root/gcc-trunk$ cat svn.diffs.7-1-2019 
Index: gcc/doc/extend.texi
===
--- gcc/doc/extend.texi (revision 272909)
+++ gcc/doc/extend.texi (working copy)
@@ -5371,6 +5371,8 @@ Kernel functions must have @code{void} return type
 @node PowerPC Function Attributes
 @subsection PowerPC Function Attributes

+kelvin is clowning around here to try to figure out mklog behavior.
+
 These function attributes are supported by the PowerPC back end:

 @table @code

[Bug c/68212] New: Loop unroller breaks basic block frequencies

2015-11-04 Thread kelvin.nilsen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68212

Bug ID: 68212
   Summary: Loop unroller breaks basic block frequencies
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: kelvin.nilsen at gmail dot com
  Target Milestone: ---

Here’s a very simple program to demonstrate the existing problems:

void foo(double *d, unsigned long int n) {
  unsigned long int i;

  for (i=0;i> 4;
   mod4_elements = extended_element_count & 0x03;
  goto B9;  /* fall through, probability 100%, frequency 819 */

 B9: /* frequency 819 */
   *((double *) ivtmp.6) = zero_preload;
   ivtmp.6 += 16;
   if (ivtmp.6 == _17) goto B10; /* probability 91%, frequency 745 */
  else goto B7; /* fall through, probability 9%, frequency 74 */

 B10: /* frequency 745 */
 /* no code */
 goto BB23;  /* fall through, probability 75%, frequency 559 */
 /* WRONG: probability should be 100%, frequency should be 745 */

 B23: /* frequency 497: WRONG: B10 is the only predecessor, frequency 
   * should be 559 based on existing B10 information 
   */
if (mod4_elements == 0) goto B22; /* 25% probability, frequency 124 */
else goto BB19; /* fall through, probability 100%, frequency 497. 
WRONG: should be probability 75%, frequency 373 */

 B19: /* frequency: 373.  INCONSISTENT with B23 data, but this is a correct
value by some standard. */
 if (mod4_elements == 1) goto BB18; /* 33% probability, frequency 123
*/
 else goto B15; /* fall-through, probability 100%, frequency 373. 
WRONG: should be probability 67%, frequency 250 */

 B15: /* frequency: 745.  WRONG: only predecessor is B19, should be 373 as B19
is currently described */
 if (mod4_elements == 2) goto B14; /* probability 50%, frequency = 373
*/
 else goto B11; /* fall through, probability 100%, frequency 745. 
WRONG: should be probability 50%, frequency 373 */

 B11: /* frequency 745 */
 /* note: mod4_elements == 3 */
 goto B12;  /* fall through, probability 100%, frequency = 745 */

 B12: /* frequency 745 */
 *((double *) ivtmp.6) = zero_preload;
 ivtmp.6 += 16;
 goto B13;  /* fall through, probability 100%, frequency 745 */

 B13: /* frequency 745 */
  /* no code */
  goto B14; */ fall through, probability 100%, frequency 745 */

 B14: /* frequency 745  WRONG: predecessors are B13 and B15, should be 1118 =
745 + 373 */
 /* no code */
 goto B16;  /* fall through, probability 100%, frequency 745 */

 B16: /* frequency 745 */
 *((double *) ivtmp.6) = zero_preload;
 ivtmp.6 += 16;
 goto B17; /* fall through, probability 100%, frequency 745 */

 B17: /* frequency 745 */
 goto B18; /* fall through, probability 100%, frequency 745 */

 B18: /* frequency 745. WRONG: predecessors are B19 and B17.  should be 868 =
123 + 745 */
 goto B20; /* fall through, probability 100%, frequency 745 */

 B20: /* frequency 745 */
 *((double *) ivtmp.6) = zero_preload;
 ivtmp.6 += 16;
 if (ivtmp.6 != _17) goto B21;  /* probability 91%, frequency 678 */
 else goto B7; /* fall through, 9%, frequency 67 */

 B21: /* frequency 678 */
 /* no code */
 goto B22; /* fall through, probability 100%, frequency 678 */

 B22: /* frequency 678. WRONG: should be 802 = 678 (predecessor B21) + 124
(predecessor B23) */
 goto B5; /* fall through, probability 100%, frequency 678 */

 B24: /* frequency 1884 */
 *((double *) ivtmp.6) = zero_preload;
 ivtmp.6 = unrolled_ivtmp_base + 16;
 goto B25; /* fall through, probability 100%, frequency 1884 */

 B25: /* frequency 1884 */
 /* no code */
 goto B26; /* fall through, probability 100%, frequency 1884 */

 B26: /* frequency 1884 */
 *((double *) ivtmp.6) = zero_preload;
 ivtmp.6 = unrolled_ivtmp_base + 32;
 goto B27;

 B27: /* frequency 1884 */
 /* no code */
 goto B28; /* fall through, probability 100%, frequency 1884 */

 B28: /* frequency 1884 */
 *((double *) ivtmp.6) = zero_preload;
 ivtmp.6 = unrolled_ivtmp_base + 48;
 if (ivtmp.6 != _17) goto B29; /* probability 91%, frequency 1715 */
 else goto B7;  /* fall through, probability 9%, frequency 170 */

 B29: /* frequency 1715 */
 /* no code */
 goto B5; /* fall through, probability 100%, frequency 1715 */

 B5: /* frequency 1884. WRONG: should be 2393 = 678 (predecessor B22) + 1715
(predecessor B29) */
   /* Note: as represented currently, the frequency of the original loop 
* body has been divided by 4 as a consequence of unrolling the loop 
* 4 times.  As part of our planned improvements, we intend to not 
* div