Bug 1797160 - gcc 10: g++ ICE on s390x
Summary: gcc 10: g++ ICE on s390x
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 32
Hardware: s390x
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1800201
TreeView+ depends on / blocked
 
Reported: 2020-02-01 04:16 UTC by Jerry James
Modified: 2020-10-05 08:33 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-31 09:30:11 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Compressed preprocessed source (160.70 KB, application/x-xz)
2020-02-01 04:16 UTC, Jerry James
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 93533 0 P1 RESOLVED [10 Regression] ICE due to popcounthi2 expansion with -march=z196 since r10-3720 2020-03-31 09:30:02 UTC

Description Jerry James 2020-02-01 04:16:13 UTC
Created attachment 1656894 [details]
Compressed preprocessed source

Description of problem:
During the mass rebuild, tlx failed to build on s390x only, due to an internal compiler error in g++.  I removed compiler flags until it went away, so I can report that the ICE does not happen with -O0, but does with all higher optimization levels.  With only some preprocessor options and -O as arguments, this is the output:

/builddir/build/BUILD/tlx-0.5.20191212/tests/math_test.cpp: In function 'void test_popcount()':
/builddir/build/BUILD/tlx-0.5.20191212/tests/math_test.cpp:220:1: error: unrecognizable insn:
  220 | }
      | ^
(insn 138 137 139 27 (set (reg:SI 190)
        (ashift:SI (reg:HI 95 [ _105 ])
            (const_int 8 [0x8]))) -1
     (nil))
during RTL pass: vregs
/builddir/build/BUILD/tlx-0.5.20191212/tests/math_test.cpp:220:1: internal compiler error: in extract_insn, at recog.c:2294
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccS4ewtK.out file, please attach this to your bugreport.

The preprocessed source is attached.

Version-Release number of selected component (if applicable):
gcc-c++-10.0.1-0.6.fc32.s390x

How reproducible:
Always

Steps to Reproduce:
1. Run g++ -O on the attached preprocessed source
2.
3.

Actual results:
Internal compiler error

Expected results:
An object file

Additional info:

Comment 1 Jakub Jelinek 2020-02-01 11:40:16 UTC
Simplified testcase with -O -march=zEC12:
unsigned short a;

unsigned
foo (void)
{
  a = a - (a >> 1 & 21845);
  a = (a & 13107) + (a >> 2 & 13107);
  return (unsigned short) ((a + (a >> 4) & 3855) * 257) >> 8;
}

Started with https://gcc.gnu.org/r276721 when the above started to be recognized as 16-bit popcount.

Comment 2 Ben Cotton 2020-02-11 16:40:37 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.


Note You need to log in before you can comment on or make changes to this bug.