[Bug ipa/96734] gcc 10.2.0 fails to compile on mips64 due to crash in IPA SRA pass

2020-08-24 Thread ariadne at dereferenced dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96734

--- Comment #6 from Ariadne Conill  ---
(In reply to Ariadne Conill from comment #5)
> I should clarify.
> 
> I cross-compiled g++ 10.2.0 to run on mips64 *host*.  That part worked fine.
> 
> Afterwards, the *host* mips64 g++ cannot compile itself.
> 
> The *host* mips64 g++ (which was cross-compiled from an aarch64 machine), is
> built with:
> 
> Configured with: /home/buildozer/aports/main/gcc/src/gcc-10.2.0/configure
> --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
> --build=mips64-alpine-linux-musl --host=mips64-alpine-linux-musl
> --target=mips64-alpine-linux-musl --with-pkgversion='Alpine 10.2.0'
> --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch
> --disable-multilib --disable-nls --disable-werror --disable-symvers
> --enable-__cxa_atexit --enable-default-pie --enable-default-ssp
> --enable-cloog-backend --enable-languages=c,c++,d,objc,fortran,ada
> --with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft
> --with-abi=64 --disable-bootstrap --disable-libquadmath --disable-libssp
> --disable-libmpx --disable-libmudflap --disable-libsanitizer --enable-shared
> --enable-threads --enable-tls --disable-libitm --with-system-zlib
> --with-linker-hash-style=sysv
> 
> So we have this crashing whenever we try to build gcc with 10.2.0 on a
> mips64 host, either rebuilding from gcc 9.3.0 or from cross-compiled 10.2.0.

An easy way to observe the behavior for yourself would be to use an Alpine
chroot on a mips64 host (I think the GCC build farm has one, if not, I can
facilitate access to a mips64 container).

[Bug ipa/96734] gcc 10.2.0 fails to compile on mips64 due to crash in IPA SRA pass

2020-08-24 Thread ariadne at dereferenced dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96734

--- Comment #5 from Ariadne Conill  ---
I should clarify.

I cross-compiled g++ 10.2.0 to run on mips64 *host*.  That part worked fine.

Afterwards, the *host* mips64 g++ cannot compile itself.

The *host* mips64 g++ (which was cross-compiled from an aarch64 machine), is
built with:

Configured with: /home/buildozer/aports/main/gcc/src/gcc-10.2.0/configure
--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--build=mips64-alpine-linux-musl --host=mips64-alpine-linux-musl
--target=mips64-alpine-linux-musl --with-pkgversion='Alpine 10.2.0'
--enable-checking=release --disable-fixed-point --disable-libstdcxx-pch
--disable-multilib --disable-nls --disable-werror --disable-symvers
--enable-__cxa_atexit --enable-default-pie --enable-default-ssp
--enable-cloog-backend --enable-languages=c,c++,d,objc,fortran,ada
--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft
--with-abi=64 --disable-bootstrap --disable-libquadmath --disable-libssp
--disable-libmpx --disable-libmudflap --disable-libsanitizer --enable-shared
--enable-threads --enable-tls --disable-libitm --with-system-zlib
--with-linker-hash-style=sysv

So we have this crashing whenever we try to build gcc with 10.2.0 on a mips64
host, either rebuilding from gcc 9.3.0 or from cross-compiled 10.2.0.

[Bug ipa/96734] gcc 10.2.0 fails to compile on mips64 due to crash in IPA SRA pass

2020-08-24 Thread ariadne at dereferenced dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96734

--- Comment #3 from Ariadne Conill  ---
When that method.ii is compiled against g++ 9.3.0 with the provided options, it
compiles successfully.

When built using a cross-compiled g++ 10.2.0, it crashes.  So, the issue is
specific to 10.2.0 it seems.

[Bug ipa/96734] gcc 10.2.0 fails to compile on mips64 due to crash in IPA SRA pass

2020-08-21 Thread ariadne at dereferenced dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96734

--- Comment #1 from Ariadne Conill  ---
Manually compiling cp/method.o using:

g++ -c -o cp/method.o -O2 method.ii

works fine.

I wonder if this is somehow related to pre-compiled headers, actually.

[Bug ipa/96734] New: gcc 10.2.0 fails to compile on mips64 due to crash in IPA SRA pass

2020-08-21 Thread ariadne at dereferenced dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96734

Bug ID: 96734
   Summary: gcc 10.2.0 fails to compile on mips64 due to crash in
IPA SRA pass
   Product: gcc
   Version: 10.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ariadne at dereferenced dot org
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

When building gcc 10.2.0 using previous gcc 9.3.0 on a mips64 host, gcc 10.2.0
crashes while building stage3:

during IPA pass: sra
In file included from
/home/buildozer/aports/main/gcc/src/gcc-10.2.0/gcc/cp/method.c:3199:
./gt-cp-method.h:36:2: internal compiler error: Segmentation fault
   36 | };
  |  ^
0x1208017a3 crash_signal
/home/buildozer/aports/main/gcc/src/gcc-10.2.0/gcc/toplev.c:328
0x12041ef55 cgraph_edge::redirect_callee(cgraph_node*)
/home/buildozer/aports/main/gcc/src/gcc-10.2.0/gcc/cgraph.c:1374
0x120431cd3 cgraph_edge::redirect_callee_duplicating_thunks(cgraph_node*)
/home/buildozer/aports/main/gcc/src/gcc-10.2.0/gcc/cgraphclones.c:262
0x120432167 cgraph_node::create_clone(tree_node*, profile_count, bool,
vec, bool, cgraph_node*, ipa_param_adjustments*,
char const*)
/home/buildozer/aports/main/gcc/src/gcc-10.2.0/gcc/cgraphclones.c:427
0x12043258b cgraph_node::create_virtual_clone(vec, vec*, ipa_param_adjustments*, char
const*, unsigned int)
/home/buildozer/aports/main/gcc/src/gcc-10.2.0/gcc/cgraphclones.c:613
0x1205eba27 process_isra_node_results
/home/buildozer/aports/main/gcc/src/gcc-10.2.0/gcc/ipa-sra.c:3811
0x1205eba27 ipa_sra_analysis
/home/buildozer/aports/main/gcc/src/gcc-10.2.0/gcc/ipa-sra.c:4047
0x1205eba27 execute
/home/buildozer/aports/main/gcc/src/gcc-10.2.0/gcc/ipa-sra.c:4099
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Full log of building cp/method.o:
https://distfiles.dereferenced.org/method.log

method.ii:
https://distfiles.dereferenced.org/method.ii

Unfortunately I wouldn't know where to begin creating a reduced test case for
this.  Sorry.

I suspect the issue is because `caller` is null, which means
to->check_calls_comdat_local_p() does a null dereference when trying to fetch
the vtable.  But I could be wrong entirely.  :)