fails to cross-compile for sparc64

Bug #1581843 reported by wbx
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Stress-ng
Fix Released
High
Colin Ian King
gcc
Won't Fix
Medium

Bug Description

Hi,

in buildroot we have stress-ng package with version 0.04.16 and it fails
to cross-compile for sparc64 with following gcc ICE:
stress-vecmath.c: In function ‘stress_vecmath’:
stress-vecmath.c:48:4: internal compiler error: in emit_library_call_value_1, at calls.c:3779
  a *= s; \
    ^
stress-vecmath.c:114:4: note: in expansion of macro ‘OPS’
    OPS(a64, b64, c64, s64);
    ^
Please submit a full bug report,
with preprocessed source if appropriate.

Latest 0.06.01 fails, too.
Any idea? GCC 4.9.3 is used.

best regards
 Waldemar

Revision history for this message
In , John Paul Adrian Glaubitz (glaubitz) wrote :

Created attachment 38445
Pre-processed source for stress-vecmath.c

Hi!

When building stress-ng on powerpc-linux-gnuspe, an internal compiler error occurs when compiling stress-vecmath.c:

cc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wextra -DVERSION="0.06.01" -O2 -DHAVE_APPARMOR -DHAVE_KEYUTILS_H -DHAVE_XATTR_H -DHAVE_LIB_BSD -DHAVE_LIB_Z -DHAVE_LIB_CRYPT -DHAVE_LIB_RT -DHAVE_LIB_PTHREAD -DHAVE_FLOAT_DECIMAL -DHAVE_SECCOMP_H -DHAVE_LIB_AIO -DHAVE_SYS_CAP_H -c -o stress-vecmath.o stress-vecmath.c
stress-vecmath.c: In function 'stress_vecmath':
stress-vecmath.c:49:4: internal compiler error: in expand_expr_real_2, at expr.c:9348
  a ^= c; \
    ^
stress-vecmath.c:114:4: note: in expansion of macro 'OPS'
    OPS(a64, b64, c64, s64);
    ^
0x103166eb expand_expr_real_2(separate_ops*, rtx_def*, machine_mode, expand_modifier)
 ../../src/gcc/expr.c:9348
0x1021f24b expand_gimple_stmt_1
 ../../src/gcc/cfgexpand.c:3462
0x1021f24b expand_gimple_stmt
 ../../src/gcc/cfgexpand.c:3522
0x10222ed3 expand_gimple_basic_block
 ../../src/gcc/cfgexpand.c:5534
0x10224f33 execute
 ../../src/gcc/cfgexpand.c:6152
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccRHm88P.out file, please attach this to your bugreport.

This has been failing for quite some time. However, it seems it does not seem to be related to gcc directly as both the last successful build [1] and the last unsuccessful build [2] used both the same revision of gcc-4.9.2: r218987.

Attaching the pre-processed source from the last build with gcc-5.

Adrian

> [1] https://buildd.debian.org/status/fetch.php?pkg=stress-ng&arch=powerpcspe&ver=0.03.12-1&stamp=1422673290
> [2] https://buildd.debian.org/status/fetch.php?pkg=stress-ng&arch=powerpcspe&ver=0.03.13-1&stamp=1422840779

Revision history for this message
Colin Ian King (colin-king) wrote :
Revision history for this message
Colin Ian King (colin-king) wrote :

There has been an upstream bug against gcc filed against this issue:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71012

no longer affects: stress-ng (Ubuntu)
Revision history for this message
Colin Ian King (colin-king) wrote :

Do you mind adding the failure you are seeing to the upstream bug report as this seems to occur on more than one architecture.

Revision history for this message
Colin Ian King (colin-king) wrote :

For the moment, I've added an auto-detect workaround in the build phase of stress-ng. Attached is a patch. Do you mind trying this out?

Thanks

Changed in stress-ng:
importance: Undecided → High
assignee: nobody → Colin Ian King (colin-king)
Revision history for this message
Colin Ian King (colin-king) wrote :

Ignore the above fix, it's not correct. I've pushed a more generic solution to the stress-ng git repository, the fix is the following commit:

http://kernel.ubuntu.com/git/cking/stress-ng.git/commit/?id=9b5a3aaffdd613f03c10ebe3550b89193e9993ef

Changed in stress-ng:
status: New → Fix Committed
Revision history for this message
wbx (k-mail-n) wrote :

Hi Colin,

thanks for the quick fix. Buildroot package was updated to latest release, which builds now.

thx
 Waldemar

Revision history for this message
Colin Ian King (colin-king) wrote :

Fixes in stress-ng 0.06.01

Changed in stress-ng:
status: Fix Committed → Fix Released
Revision history for this message
In , Pinskia (pinskia) wrote :
Revision history for this message
In , Asolokha (asolokha) wrote :

I can reproduce it w/ gcc 5.4.0, but cannot w/ 7.0.0-alpha20170205 snapshot.

Revision history for this message
In , John Paul Adrian Glaubitz (glaubitz) wrote :

(In reply to Arseny Solokha from comment #2)
> I can reproduce it w/ gcc 5.4.0, but cannot w/ 7.0.0-alpha20170205 snapshot.

We also haven't seen it in Debian since last May, see:

> https://buildd.debian.org/status/logs.php?pkg=stress-ng&arch=powerpcspe

stress-ng has been building fine ever since.

Changed in gcc:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
In , Asolokha (asolokha) wrote :

int mw;

int
j3 (int cn)
{
  const int l7 = 0;
  int wz;

  for (wz = l7; wz < l7 + 3; ++wz)
    while (mw != 0)
      {
        cn ^= -(wz == l7);
        ++mw;
      }

  return cn;
}

actually leads to ICE w/ -O2 (-O3, -Ofast) -ftree-vectorize all the way from gcc-8.0.0-alpha20170507 snapshot down to 4.9:

% powerpc-e500v2-linux-gnuspe-gcc-8.0.0-alpha20170507 -O2 -ftree-vectorize -c ndknofut.c
ndknofut.c: In function 'j3':
ndknofut.c:12:12: internal compiler error: in expand_expr_real_2, at expr.c:9069
         cn ^= -(wz == l7);
         ~~~^~~~~~~~~~~~~~
0x8a1b2a expand_expr_real_2(separate_ops*, rtx_def*, machine_mode, expand_modifier)
 /var/tmp/portage/cross-powerpc-e500v2-linux-gnuspe/gcc-8.0.0_alpha20170507/work/gcc-8-20170507/gcc/expr.c:9069
0x74e4de expand_gimple_stmt_1
 /var/tmp/portage/cross-powerpc-e500v2-linux-gnuspe/gcc-8.0.0_alpha20170507/work/gcc-8-20170507/gcc/cfgexpand.c:3676
0x74e4de expand_gimple_stmt
 /var/tmp/portage/cross-powerpc-e500v2-linux-gnuspe/gcc-8.0.0_alpha20170507/work/gcc-8-20170507/gcc/cfgexpand.c:3737
0x7510e7 expand_gimple_basic_block
 /var/tmp/portage/cross-powerpc-e500v2-linux-gnuspe/gcc-8.0.0_alpha20170507/work/gcc-8-20170507/gcc/cfgexpand.c:5744
0x7576df execute
 /var/tmp/portage/cross-powerpc-e500v2-linux-gnuspe/gcc-8.0.0_alpha20170507/work/gcc-8-20170507/gcc/cfgexpand.c:6357

Revision history for this message
In , Segher-8 (segher-8) wrote :

The powerpcspe backend has been deprecated in GCC 8 and removed during GCC 9 development. See corresponding mailing list threads[1,2,3] for details.

[1] https://gcc.gnu.org/legacy-ml/gcc/2018-04/msg00102.html
[2] https://gcc.gnu.org/legacy-ml/gcc-patches/2018-12/msg00123.html
[3] https://gcc.gnu.org/pipermail/gcc/2020-May/232342.html

Changed in gcc:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.