Comment 3 for bug 1887557

Revision history for this message
In , Marxin-m (marxin-m) wrote :

Reduced test-case:

$ cat pr96130.c
enum {
  PIPE_FUNC_NEVER,
  PIPE_FUNC_LESS,
  PIPE_FUNC_EQUAL,
  PIPE_FUNC_LEQUAL,
  PIPE_FUNC_GREATER,
  PIPE_FUNC_NOTEQUAL,
  PIPE_FUNC_GEQUAL,
  PIPE_FUNC_ALWAYS
} sample_compare_k_0;

int sample_compare_rgba;
struct pipe_sampler_state {
  unsigned compare_func : 3;
};

void
sample_compare(struct pipe_sampler_state *sp_samp) {
  switch (sp_samp->compare_func) {
  case PIPE_FUNC_LESS:
  case PIPE_FUNC_LEQUAL:
  case PIPE_FUNC_GREATER:
  case PIPE_FUNC_GEQUAL:
  case PIPE_FUNC_EQUAL:
  case PIPE_FUNC_NOTEQUAL:
    sample_compare_k_0 != sample_compare_rgba;
  case PIPE_FUNC_ALWAYS:
  case PIPE_FUNC_NEVER:
    break;
  default:
    for (;;)
      ;
  }
}

fails here:

$ gcc pr96130.c -c -O1
during IPA pass: fnsummary
pr96130.c: In function ‘sample_compare’:
pr96130.c:34:1: internal compiler error: Segmentation fault
   34 | }
      | ^
0xdc22ef crash_signal
 /home/marxin/Programming/gcc/gcc/toplev.c:328
0x7ffff78d752f ???
 /usr/src/debug/glibc-2.31-6.1.x86_64/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0xb938f9 analyze_function_body
 /home/marxin/Programming/gcc/gcc/ipa-fnsummary.c:2769
0xb944e3 compute_fn_summary(cgraph_node*, bool)
 /home/marxin/Programming/gcc/gcc/ipa-fnsummary.c:2974
0xb94990 inline_analyze_function(cgraph_node*)
 /home/marxin/Programming/gcc/gcc/ipa-fnsummary.c:4078
0xb94b73 ipa_fn_summary_generate
 /home/marxin/Programming/gcc/gcc/ipa-fnsummary.c:4121
0xcea35b execute_ipa_summary_passes(ipa_opt_pass_d*)
 /home/marxin/Programming/gcc/gcc/passes.c:2191
0x966a97 ipa_passes
 /home/marxin/Programming/gcc/gcc/cgraphunit.c:2646
0x966a97 symbol_table::compile()
 /home/marxin/Programming/gcc/gcc/cgraphunit.c:2756
0x96885c symbol_table::compile()
 /home/marxin/Programming/gcc/gcc/cgraphunit.c:2736
0x96885c symbol_table::finalize_compilation_unit()
 /home/marxin/Programming/gcc/gcc/cgraphunit.c:3003
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.

started with