Bug 71012 - ICE: in expand_expr_real_2, at expr.c:9348 when compiling stress-ng
Summary: ICE: in expand_expr_real_2, at expr.c:9348 when compiling stress-ng
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 5.3.1
: P3 normal
Target Milestone: 8.5
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-08 21:04 UTC by John Paul Adrian Glaubitz
Modified: 2020-06-02 23:56 UTC (History)
2 users (show)

See Also:
Host: powerpc-linux-gnuspe
Target: powerpc-linux-gnuspe
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Pre-processed source for stress-vecmath.c (37.26 KB, text/x-csrc)
2016-05-08 21:04 UTC, John Paul Adrian Glaubitz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Paul Adrian Glaubitz 2016-05-08 21:04:46 UTC
Created attachment 38445 [details]
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
Comment 2 Arseny Solokha 2017-02-10 08:55:04 UTC
I can reproduce it w/ gcc 5.4.0, but cannot w/ 7.0.0-alpha20170205 snapshot.
Comment 3 John Paul Adrian Glaubitz 2017-02-10 10:03:11 UTC
(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.
Comment 4 Arseny Solokha 2017-05-10 09:24:22 UTC
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
Comment 5 Segher Boessenkool 2020-06-02 23:56:18 UTC
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