NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

toolchain/50570: powerpc gcc 4.8.4 4.8.5 -O3 -maltivec internal compiler error



>Number:         50570
>Category:       toolchain
>Synopsis:       powerpc gcc 4.8.4 4.8.5 -O3 -maltivec internal compiler error
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 18 18:35:01 +0000 2015
>Originator:     John D. Baker
>Release:        NetBSD/macppc-7.99.24
>Organization:
>Environment:
NetBSD sawtooth.technoskunk.fur 7.99.24 NetBSD 7.99.24 (GENERIC) #3: Tue Dec 15 23:53:57 CST 2015  sysop%x3650.technoskunk.fur@localhost:/r0/build/current/obj/macppc/sys/arch/macppc/compile/GENERIC macppc
>Description:
First encountered in pkg/49600 and discussed in the thread starting
here:

  http://mail-index.netbsd.org/pkgsrc-users/2015/12/17/msg022725.html

but more properly here:

  http://mail-index.netbsd.org/pkgsrc-users/2015/12/18/msg022733.html

with a test case here:

  http://mail-index.netbsd.org/pkgsrc-users/2015/12/18/msg022740.html

Compiling certain code with both "-O3" and "-maltivec" provokes an
internal compiler error:

$ cc -O3 -maltivec -o avecbug.o avecbug.c 
rs6000_secondary_reload_inner:17198, type = load
(parallel [
        (set (reg:V8HI 82 5)
            (mem:V8HI (and:SI (reg:SI 65 lr [orig:1093 D.2414 ] [1093])
                    (const_int -16 [0xfffffffffffffff0])) [1 MEM[(uint16_t *)_890 & 4294967280B]+0 S16 A128]))
        (clobber (reg:SI 16 16))
    ])
avecbug.c: In function 'vp9_temporal_filter_apply_c':
avecbug.c:46:1: internal compiler error: in rs6000_secondary_reload_fail, at config/rs6000/rs6000.c:16989
 }
 ^
no stack trace because unwind library not available
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://www.NetBSD.org/support/send-pr.html> for instructions.

>How-To-Repeat:
Test case--compile with "-O3 -maltivec" using gcc 4.8.4 (7.0) or
gcc 4.8.5 (7.0_STABLE, -current) on any NetBSD powerpc platform.

typedef unsigned char uint8_t;
typedef unsigned short uint16_t;

void vp9_temporal_filter_apply_c(uint8_t *frame1,
                                 unsigned int stride,
                                 uint8_t *frame2,
                                 unsigned int block_width,
                                 unsigned int block_height,
                                 int strength,
                                 int filter_weight,
                                 unsigned int *accumulator,
                                 uint16_t *count) {
  unsigned int i, j, k;
  int modifier;
  int byte = 0;
  const int rounding = strength > 0 ? 1 << (strength - 1) : 0;

  for (i = 0, k = 0; i < block_height; i++) {
    for (j = 0; j < block_width; j++, k++) {
      int src_byte = frame1[byte];
      int pixel_value = *frame2++;

      modifier   = src_byte - pixel_value;
      // This is an integer approximation of:
      // float coeff = (3.0 * modifer * modifier) / pow(2, strength);
      // modifier =  (int)roundf(coeff > 16 ? 0 : 16-coeff);
      modifier  *= modifier;
      modifier  *= 3;
      modifier  += rounding;
      modifier >>= strength;

      if (modifier > 16)
        modifier = 16;

      modifier = 16 - modifier;
      modifier *= filter_weight;

      count[k] += modifier;
      accumulator[k] += modifier * pixel_value;

      byte++;
    }

    byte += stride - block_width;
  }
}

>Fix:
Workaround:

omit either one of "-maltivec" or "-O3" (or reduce optimization to "-O2"
or less).



Home | Main Index | Thread Index | Old Index