Bug 1522675 - gcc: internal compiler error: in store_data_bypass_p, at recog.c:3737
Summary: gcc: internal compiler error: in store_data_bypass_p, at recog.c:3737
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 28
Hardware: ppc64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1512531
TreeView+ depends on / blocked
 
Reported: 2017-12-06 09:03 UTC by Florian Weimer
Modified: 2018-04-30 14:36 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2018-04-30 14:36:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Preprocessed sources (640.75 KB, text/plain)
2017-12-06 09:28 UTC, Florian Weimer
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 80101 0 None None None 2017-12-06 11:28:48 UTC

Description Florian Weimer 2017-12-06 09:03:45 UTC
With gcc-7.2.1-4.fc28.ppc64, I get this internal compiler error when compiling glibc:

gcc -m64 -mcpu=power6 vfwprintf.c -c -std=gnu11 -fgnu89-inline  -O2 -Wall -Werror -Wundef -Wwrite-strings -fmerge-all-constants -frounding-math -fstack-clash-protection -fstack-protector-strong -g -mcpu=power6 -Wstrict-prototypes -Wold-style-definition -mlong-double-128  -fpic -Wno-uninitialized -fexceptions  -ftls-model=initial-exec      -I../include -I/builddir/build/BUILD/glibc-2.26.9000-936-g37ac8e635a/build-ppc64-redhat-linux-power6/stdio-common  -I/builddir/build/BUILD/glibc-2.26.9000-936-g37ac8e635a/build-ppc64-redhat-linux-power6  -I../sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu  -I../sysdeps/unix/sysv/linux/powerpc/powerpc64  -I../sysdeps/unix/sysv/linux/wordsize-64  -I../sysdeps/unix/sysv/linux/powerpc  -I../sysdeps/powerpc/nptl  -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  -I../sysdeps/unix/powerpc  -I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/powerpc/powerpc64/power6/fpu/multiarch  -I../sysdeps/powerpc/powerpc64/power5+/fpu/multiarch  -I../sysdeps/powerpc/powerpc64/power5/fpu/multiarch  -I../sysdeps/powerpc/powerpc64/power4/fpu/multiarch  -I../sysdeps/powerpc/powerpc64/fpu/multiarch  -I../sysdeps/powerpc/powerpc64/power6/fpu  -I../sysdeps/powerpc/powerpc64/power5+/fpu  -I../sysdeps/powerpc/powerpc64/power5/fpu  -I../sysdeps/powerpc/powerpc64/power4/fpu/  -I../sysdeps/powerpc/powerpc64/fpu  -I../sysdeps/powerpc/powerpc64/power6/multiarch  -I../sysdeps/powerpc/powerpc64/power5+/multiarch  -I../sysdeps/powerpc/powerpc64/power5/multiarch  -I../sysdeps/powerpc/powerpc64/power4/multiarch  -I../sysdeps/powerpc/powerpc64/multiarch  -I../sysdeps/powerpc/powerpc64/power6  -I../sysdeps/powerpc/powerpc64/power5+  -I../sysdeps/powerpc/power5+/fpu  -I../sysdeps/powerpc/power5+  -I../sysdeps/powerpc/powerpc64/power5  -I../sysdeps/powerpc/powerpc64/power4/fpu  -I../sysdeps/powerpc/powerpc64/power4  -I../sysdeps/powerpc/power4/fpu  -I../sysdeps/powerpc/power4  -I../sysdeps/powerpc/powerpc64  -I../sysdeps/wordsize-64  -I../sysdeps/powerpc/fpu  -I../sysdeps/powerpc  -I../sysdeps/ieee754/ldbl-128ibm/include -I../sysdeps/ieee754/ldbl-128ibm  -I../sysdeps/ieee754/ldbl-opt  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754/flt-32  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/ppc64-redhat-linux/7/include -isystem /usr/include  -D_LIBC_REENTRANT -include /builddir/build/BUILD/glibc-2.26.9000-936-g37ac8e635a/build-ppc64-redhat-linux-power6/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h  -DPIC -DSHARED     -DTOP_NAMESPACE=glibc -D_IO_MTSAFE_IO -o /builddir/build/BUILD/glibc-2.26.9000-936-g37ac8e635a/build-ppc64-redhat-linux-power6/stdio-common/vfwprintf.os -MD -MP -MF /builddir/build/BUILD/glibc-2.26.9000-936-g37ac8e635a/build-ppc64-redhat-linux-power6/stdio-common/vfwprintf.os.dt -MT /builddir/build/BUILD/glibc-2.26.9000-936-g37ac8e635a/build-ppc64-redhat-linux-power6/stdio-common/vfwprintf.os
make[2]: Leaving directory '/builddir/build/BUILD/glibc-2.26.9000-936-g37ac8e635a/stdio-common'
In file included from vfwprintf.c:3:0:
vfprintf.c: In function 'buffered_vfprintf':
vfprintf.c:2360:1: internal compiler error: in store_data_bypass_p, at recog.c:3737
 }
 ^

I'm trying to obtain preprocessed sources, but Fedora ppc64 does not install in Beaker at present and POWER machines are generally scarce, so I don't know how quickly I will be able to provide this information.

(Curiously, the same error does not happen on ppc64le.)

Comment 1 Jakub Jelinek 2017-12-06 09:12:33 UTC
A hack could be to build with a modified spec that will
make || :
( tar cf - /tmp/cc*.out | bzip2 -9 | uuencode cc.tar.bz2 )
or similar (with appropriate BuildRequires for sharutils) and assuming gcc left the /tmp/cc*.out file around (it should tell you that).

Comment 2 Florian Weimer 2017-12-06 09:28:41 UTC
Created attachment 1363573 [details]
Preprocessed sources

(In reply to Jakub Jelinek from comment #1)
> A hack could be to build with a modified spec that will
> make || :
> ( tar cf - /tmp/cc*.out | bzip2 -9 | uuencode cc.tar.bz2 )
> or similar (with appropriate BuildRequires for sharutils) and assuming gcc
> left the /tmp/cc*.out file around (it should tell you that).

That worked.

Comment 3 Jakub Jelinek 2017-12-06 10:31:42 UTC
This is caused by the stack clash stuff (and can't be reproduced on the trunk), but I'd say it is likely latent everywhere.
rs6000.md type attribute has the default of integer.
And e.g. power6 has:
(define_insn_reservation "power6-integer" 1
  (and (ior (eq_attr "type" "integer")
            (and (eq_attr "type" "add,logical")
                 (eq_attr "dot" "no")))
       (eq_attr "cpu" "power6"))
  "FXU_power6")
and
(define_bypass 1 "power6-integer,\
                  power6-exts,\
                  power6-shift,\
                  power6-insert,\
                  power6-insert-dword"
                 "power6-store,\
                  power6-store-update,\
                  power6-store-update-indexed,\
                  power6-fpstore,\
                  power6-fpstore-update"
  "store_data_bypass_p")
The problem is that store_data_bypass_p relies on the insns it is presented with to be either a single_set, or a PARALLEL with SETs and CLOBBERs, nothing else.
So, from this POV it is just wrong that the blockage, eh_set_lr_<mode> and rs6000_mtfsf insns and maybe also nop, group_ending_nop insns which have as PATTERN either UNSPEC_VOLATILE, or PARALLEL with UNSPEC_VOLATILE, or the last 2 UNSPEC, have the default type of "integer".  They should have some different type, the powerpc maintainers need to decide which.

Comment 4 Jakub Jelinek 2017-12-06 11:28:48 UTC
So, this is something that was fixed (in very weird way, as Eric B. was objecting to the initial patch and changing the type of the insns was considered too hard in the backend), but only on the trunk and 6.x branch, but not in 7.x.

Comment 5 Fedora End Of Life 2018-02-20 15:38:33 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 28 development cycle.
Changing version to '28'.

Comment 6 Marek Polacek 2018-04-30 14:36:22 UTC
Fixed for GCC 7, too.  The fix is in 7.2.1-5.


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