https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85852

            Bug ID: 85852
           Summary: ICE: Segmentation fault (in contains_struct_check)
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc-9.0.0-alpha20180520 snapshot (r260425) ICEs when compiling the following
snippet w/ -mfma -O2 (-O3, -Os) -fexceptions -fnon-call-exceptions:

void
q3 (double mo)
{
  mo = (mo / 0.0) * mo - mo;
}

% gcc-9.0.0-alpha20180520 -mfma -O2 -fexceptions -fnon-call-exceptions -c
hpyrkugn.c
during RTL pass: expand
hpyrkugn.c: In function 'q3':
hpyrkugn.c:4:6: internal compiler error: Segmentation fault
   mo = (mo / 0.0) * mo - mo;
   ~~~^~~~~~~~~~~~~~~~~~~~~~
0xc9b59f crash_signal
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180520/work/gcc-9-20180520/gcc/toplev.c:325
0xa95733 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180520/work/gcc-9-20180520/gcc/tree.h:3248
0xa95733 expand_direct_optab_fn
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180520/work/gcc-9-20180520/gcc/internal-fn.c:2894
0x87e757 expand_call_stmt
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180520/work/gcc-9-20180520/gcc/cfgexpand.c:2598
0x87e757 expand_gimple_stmt_1
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180520/work/gcc-9-20180520/gcc/cfgexpand.c:3644
0x87e757 expand_gimple_stmt
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180520/work/gcc-9-20180520/gcc/cfgexpand.c:3810
0x87fd9c expand_gimple_tailcall
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180520/work/gcc-9-20180520/gcc/cfgexpand.c:3856
0x87fd9c expand_gimple_basic_block
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180520/work/gcc-9-20180520/gcc/cfgexpand.c:5812
0x884837 execute
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180520/work/gcc-9-20180520/gcc/cfgexpand.c:6441

This is not target-specific and also reproduces on powerpc (w/ appropriate
-mcpu) at least.

Reply via email to