[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-07-27 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-07-27
 CC||hubicka at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |hubicka at gcc dot 
gnu.org
 Ever confirmed|0   |1
  Known to fail||10.0, 7.4.0, 8.3.0, 9.1.0

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-07-29 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

--- Comment #1 from Jan Hubicka  ---
This seems to work for me with current trunk

hubicka@lomikamen-jh:/aux/hubicka/trunk4/build2/gcc$ cat ~/1.ii
extern "C" {
struct {
} ltregul_;
}
hubicka@lomikamen-jh:/aux/hubicka/trunk4/build2/gcc$ cat ~/2.F
common /ltregul/ zeroeps
end 
hubicka@lomikamen-jh:/aux/hubicka/trunk4/build2/gcc$ ./gfortran -B ./ ~/1.ii
~/2.F -flto -O2 -B ../x86_64-pc-linux-gnu/libgfortran/
hubicka@lomikamen-jh:/aux/hubicka/trunk4/build2/gcc$ ./xg++ -B ./ ~/1.ii ~/2.F
-flto -O2 -B ../x86_64-pc-linux-gnu/libgfortran/
/usr/local/x86_64-pc-linux-gnu/bin/ld: /tmp/cck5WNC7.ltrans0.ltrans.o: in
function `main':
:(.text.startup+0x5): undefined reference to `_gfortran_set_args'
/usr/local/x86_64-pc-linux-gnu/bin/ld: :(.text.startup+0x14):
undefined reference to `_gfortran_set_options'
collect2: error: ld returned 1 exit status

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-07-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

--- Comment #2 from Martin Liška  ---
(In reply to Jan Hubicka from comment #1)
> This seems to work for me with current trunk

No, it's broken also on current trunk.

> 
> hubicka@lomikamen-jh:/aux/hubicka/trunk4/build2/gcc$ cat ~/1.ii
> extern "C" {
> struct {
> } ltregul_;
> }
> hubicka@lomikamen-jh:/aux/hubicka/trunk4/build2/gcc$ cat ~/2.F
> common /ltregul/ zeroeps
> end 
> hubicka@lomikamen-jh:/aux/hubicka/trunk4/build2/gcc$ ./gfortran -B ./ ~/1.ii
> ~/2.F -flto -O2 -B ../x86_64-pc-linux-gnu/libgfortran/
> hubicka@lomikamen-jh:/aux/hubicka/trunk4/build2/gcc$ ./xg++ -B ./ ~/1.ii
> ~/2.F -flto -O2 -B ../x86_64-pc-linux-gnu/libgfortran/
> /usr/local/x86_64-pc-linux-gnu/bin/ld: /tmp/cck5WNC7.ltrans0.ltrans.o: in
> function `main':
> :(.text.startup+0x5): undefined reference to `_gfortran_set_args'
> /usr/local/x86_64-pc-linux-gnu/bin/ld: :(.text.startup+0x14):
> undefined reference to `_gfortran_set_options'
> collect2: error: ld returned 1 exit status

Please run it from a location where you have properly installed compiler:

$ gcc -v
gcc --version
gcc (GCC) 10.0.0 20190723 (experimental

$ g++ 1.ii 2.F -flto -O2 
2.F:1:3: warning: type of ‘ltregul’ does not match original declaration
[-Wlto-type-mismatch]
1 |  common /ltregul/ zeroeps
  |   ^
lto1: internal compiler error: in warn_types_mismatch, at ipa-devirt.c:995
0xcab6f2 warn_types_mismatch(tree_node*, tree_node*, unsigned int, unsigned
int)
/home/marxin/Programming/gcc/gcc/ipa-devirt.c:995
0x89f8d7 lto_symtab_merge_decls_2
/home/marxin/Programming/gcc/gcc/lto/lto-symtab.c:722
0x89ffe9 lto_symtab_merge_decls_1
/home/marxin/Programming/gcc/gcc/lto/lto-symtab.c:861
0x8a00e3 lto_symtab_merge_decls()
/home/marxin/Programming/gcc/gcc/lto/lto-symtab.c:887
0x8b4854 read_cgraph_and_symbols(unsigned int, char const**)
/home/marxin/Programming/gcc/gcc/lto/lto-common.c:2839
0x885bb5 lto_main()
/home/marxin/Programming/gcc/gcc/lto/lto.c:616

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-07-29 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

--- Comment #3 from Jan Hubicka  ---
Still works for me
hubicka@lomikamen-jh:~$ /aux/hubicka/trunk-install/bin/g++ 1.ii 2.F -O2 -flto
/usr/local/bin/ld: /tmp/ccpfzvWm.ltrans0.ltrans.o: in function `main':
:(.text.startup+0x5): undefined reference to `_gfortran_set_args'
/usr/local/bin/ld: :(.text.startup+0x14): undefined reference to
`_gfortran_set_options'
collect2: error: ld returned 1 exit status

also with system compiler on tumbleweed
There is extra cat in 1.ii, perhaps it is truncated?

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-07-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

--- Comment #4 from Martin Liška  ---
Created attachment 46633
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46633&action=edit
1.ii

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-07-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

--- Comment #5 from Martin Liška  ---
Created attachment 46634
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46634&action=edit
2.F

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-07-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

--- Comment #6 from Martin Liška  ---
(In reply to Jan Hubicka from comment #3)
> Still works for me
> hubicka@lomikamen-jh:~$ /aux/hubicka/trunk-install/bin/g++ 1.ii 2.F -O2 -flto
> /usr/local/bin/ld: /tmp/ccpfzvWm.ltrans0.ltrans.o: in function `main':
> :(.text.startup+0x5): undefined reference to `_gfortran_set_args'
> /usr/local/bin/ld: :(.text.startup+0x14): undefined reference to
> `_gfortran_set_options'
> collect2: error: ld returned 1 exit status
> 
> also with system compiler on tumbleweed
> There is extra cat in 1.ii, perhaps it is truncated?

I've just uploaded test-cases, please test it. Using TW GCC:

$ g++ --version
g++ (SUSE Linux) 9.1.1 20190723 [gcc-9-branch revision 273734]

$ g++ 1.ii 2.F -flto -O2 
2.F:1:3: warning: type of ‘ltregul’ does not match original declaration
[-Wlto-type-mismatch]
1 |  common /ltregul/ zeroeps
  |   ^
lto1: internal compiler error: in warn_types_mismatch, at ipa-devirt.c:1133
0x7fc5fcd15bca __libc_start_main
../csu/libc-start.c:308

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-07-29 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

--- Comment #7 from Jan Hubicka  ---
aha, relies on indentation of common in 2.F.  i will check what goes wrong.

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-07-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |7.5

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-08-21 Thread luoxhu at cn dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

--- Comment #8 from Xiong Hu XS Luo  ---
SPEC2017 case 507.cactuBSSN_r, also has ICE failure from r273571:

lto1: internal compiler error: in warn_types_mismatch, at ipa-devirt.c:995
0x105dad1f warn_types_mismatch(tree_node*, tree_node*, unsigned int, unsigned
int)
/home/gcc/gcc-10-trunk-2019-08-16/gcc/ipa-devirt.c:995
0x101dd147 lto_symtab_merge_decls_2
/home/gcc/gcc-10-trunk-2019-08-16/gcc/lto/lto-symtab.c:723
0x101dd147 lto_symtab_merge_decls_1
/home/gcc/gcc-10-trunk-2019-08-16/gcc/lto/lto-symtab.c:862
0x101dd147 lto_symtab_merge_decls()
/home/gcc/gcc-10-trunk-2019-08-16/gcc/lto/lto-symtab.c:888
0x101f2e47 read_cgraph_and_symbols(unsigned int, char const**)
/home/gcc/gcc-10-trunk-2019-08-16/gcc/lto/lto-common.c:2839
0x101c7def lto_main()

Compiler options used: "-O3 -mcpu=power9 -flto"

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-08-23 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

--- Comment #9 from Martin Liška  ---
@Honza: Is there any progress?

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-10-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-11-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|7.5 |8.4

--- Comment #10 from Richard Biener  ---
The GCC 7 branch is being closed, re-targeting to GCC 8.4.