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

2020-11-24 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96734

Martin Liška  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

--- Comment #11 from Martin Liška  ---
Apparently, it's gone.

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

2020-11-23 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96734

--- Comment #10 from Martin Liška  ---
All right, I have a reduced test-case (with the failing stage1 compiler):

$ cat method.ii

typedef union tree_node *tree;
struct tree_typed {
  tree type;
};
struct tree_type_non_common {
  tree lang_1;
};
union tree_node {
  tree_typed typed;
  tree_type_non_common type_non_common;
};
;
struct comp_info {
  bool noex;
  comp_info(tree fndecl, int ) {
if (noex) {
  if ((fndecl)->typed.type)))->type_non_common.lang_1) )
noex = false;
}
  }
};
tree build_comparison_op_fndecl;
int build_comparison_op_complain;
void synthesize_method() {
  {
{
  comp_info (build_comparison_op_fndecl, build_comparison_op_complain);
}
  }
}

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

2020-11-16 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96734

--- Comment #9 from Martin Liška  ---
g++ -std=c++11  -fno-PIE -c   -g -DIN_GCC -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings
-fno-common  -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/.
-I../../gcc/../include -I../../gcc/../libcpp/include 
-I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/dpd -I../libdecnumber
-I../../gcc/../libbacktrace   -o calls.o -MT calls.o -MMD -MP -MF
./.deps/calls.TPo ../../gcc/calls.c
/bin/bash: line 1:  7006 Killed  build/genautomata
../../gcc/common.md ../../gcc/config/mips/mips.md insn-conditions.md >
tmp-automata.c
make[3]: *** [Makefile:2399: s-automata] Error 137


So I won't be able to help you :/

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

2020-11-16 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96734

--- Comment #8 from Martin Liška  ---
All right, there's a compile farm mips64 machine gcc24 so I'll try it there..

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

2020-11-13 Thread ncopa at alpinelinux dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96734

Natanael Copa  changed:

   What|Removed |Added

 CC||ncopa at alpinelinux dot org

--- Comment #7 from Natanael Copa  ---
I was able to reproduce using latest commit from gcc 10 branch:

/home/ncopa/aports/main/gcc/src/build/./prev-gcc/xg++
-B/home/ncopa/aports/main/gcc/src/build/./prev-gcc/
-B/usr/mips64-alpine-linux-musl/bin/ -nostdinc++
-B/home/ncopa/aports/main/gcc/src/build/prev-mips64-alpine-linux-musl/libstdc++-v3/src/.libs
-B/home/ncopa/aports/main/gcc/src/build/prev-mips64-alpine-linux-musl/libstdc++-v3/libsupc++/.libs

-I/home/ncopa/aports/main/gcc/src/build/prev-mips64-alpine-linux-musl/libstdc++-v3/include/mips64-alpine-linux-musl

-I/home/ncopa/aports/main/gcc/src/build/prev-mips64-alpine-linux-musl/libstdc++-v3/include
 -I/home/ncopa/aports/main/gcc/src/gcc-10.2.1/libstdc++-v3/libsupc++
-L/home/ncopa/aports/main/gcc/src/build/prev-mips64-alpine-linux-musl/libstdc++-v3/src/.libs
-L/home/ncopa/aports/main/gcc/src/build/prev-mips64-alpine-linux-musl/libstdc++-v3/libsupc++/.libs
-fno-PIE -c  -DIN_GCC_FRONTEND -g -O2 -fno-checking -gtoggle  -DIN_GCC
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings   -DHAVE_CONFIG_H -I. -Icp
-I/home/ncopa/aports/main/gcc/src/gcc-10.2.1/gcc
-I/home/ncopa/aports/main/gcc/src/gcc-10.2.1/gcc/cp
-I/home/ncopa/aports/main/gcc/src/gcc-10.2.1/gcc/../include
-I/home/ncopa/aports/main/gcc/src/gcc-10.2.1/gcc/../libcpp/include 
-I/home/ncopa/aports/main/gcc/src/gcc-10.2.1/gcc/../libdecnumber
-I/home/ncopa/aports/main/gcc/src/gcc-10.2.1/gcc/../libdecnumber/dpd
-I../libdecnumber
-I/home/ncopa/aports/main/gcc/src/gcc-10.2.1/gcc/../libbacktrace  -Os
-fomit-frame-pointer -o cp/method.o -MT cp/method.o -MMD -MP -MF
cp/.deps/method.TPo /home/ncopa/aports/main/gcc/src/gcc-10.2.1/gcc/cp/method.c
during IPA pass: sra
In file included from
/home/ncopa/aports/main/gcc/src/gcc-10.2.1/gcc/cp/method.c:3199:
./gt-cp-method.h:36:2: internal compiler error: Segmentation fault
   36 | };
  |  ^
0x120807513 crash_signal
/home/ncopa/aports/main/gcc/src/gcc-10.2.1/gcc/toplev.c:328
0x1204210f5 cgraph_edge::redirect_callee(cgraph_node*)
/home/ncopa/aports/main/gcc/src/gcc-10.2.1/gcc/cgraph.c:1374
0x1204340c3 cgraph_edge::redirect_callee_duplicating_thunks(cgraph_node*)
/home/ncopa/aports/main/gcc/src/gcc-10.2.1/gcc/cgraphclones.c:262
0x120434557 cgraph_node::create_clone(tree_node*, profile_count, bool,
vec, bool, cgraph_node*, ipa_param_adjustments*,
char const*)
/home/ncopa/aports/main/gcc/src/gcc-10.2.1/gcc/cgraphclones.c:427
0x12043497b cgraph_node::create_virtual_clone(vec, vec*, ipa_param_adjustments*, char
const*, unsigned int)
/home/ncopa/aports/main/gcc/src/gcc-10.2.1/gcc/cgraphclones.c:613
0x1205ee357 process_isra_node_results
/home/ncopa/aports/main/gcc/src/gcc-10.2.1/gcc/ipa-sra.c:3811
0x1205ee357 ipa_sra_analysis
/home/ncopa/aports/main/gcc/src/gcc-10.2.1/gcc/ipa-sra.c:4047
0x1205ee357 execute
/home/ncopa/aports/main/gcc/src/gcc-10.2.1/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  for instructions.
make: *** [Makefile:1117: cp/method.o] Error 1

Withs some help from Ariadne we figured out that

 it passes with -O1
 it fails with -O2 (or -Os)
 it fails with -O1 -fipa-sra -fpartial-inlining
 it fails with -Og -fipa-sra -fpartial-inlining
 it passes with -Og -fipa-sra
 it passes with -Og -fpartial-inlining
 it passes with -O2  and either -fnoipa-sra or -fnopartial-inlining
 it passes with -fipa-sra -fpartial-inlining


So it seems that it is some -Og optimization in combination with -fipa-sra
-fpartial-inlining triggers it. I have not been able to pinpoint any of the
documented -O1 or -Og optimization flags.

It fails with:
-Og -fipa-sra -fpartial-inlining  -fno-combine-stack-adjustments
-fno-compare-elim -fno-cprop-registers -fno-defer-pop -fno-ipa-profile
-fno-ipa-pure-const -fno-ipa-reference -fno-ipa-reference-addressable
-fno-merge-constants -fno-omit-frame-pointer -fno-reorder-blocks
-fno-shrink-wrap -fno-split-wide-types -fno-tree-builtin-call-dce -fno-tree-ccp
-fno-tree-ch -fno-tree-coalesce-vars -fno-tree-copy-prop -fno-tree-dce
-fno-tree-dominator-opts -fno-tree-fre -fno-tree-sink -fno-tree-slsr
-fno-tree-ter

[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 marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96734

--- Comment #4 from Martin Liška  ---
(In reply to Ariadne Conill from comment #3)
> 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.

I've just tried building 10.2.0 cross compiler (x86_64-linux-gnu as host) and I
can't reproduce it.
Which options do you use?

[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-24 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96734

Martin Liška  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2020-08-24
 Status|UNCONFIRMED |WAITING

--- Comment #2 from Martin Liška  ---
(In reply to Ariadne Conill from comment #1)
> Manually compiling cp/method.o using:
> 
> g++ -c -o cp/method.o -O2 method.ii

Can you please try it will all the original arguments:

-march=mips3 -mtune=mips64 -mabi=64 -msoft-float -mllsc -mips3 -mno-shared
-auxbase-strip cp/method.o -Os -Wextra -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wno-error=format-diag -Wsuggest-attribute=format
-Woverloaded-virtual -Wpedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -version -fno-PIE -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -fomit-frame-pointer

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

If I see correctly, pre-compiled headers are not used in your case.

[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.