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

            Bug ID: 101230
           Summary: ice in fold_cond_expr_with_comparison
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

For this C code:

int update_r_k_curr_cluster;
void update_r_k(void) {
  double curr_distance = distance3d_sqr_pt4d_pt4d();
  for (int cluster; cluster; cluster++)
    if (0 < curr_distance) {
      curr_distance = 0;
      update_r_k_curr_cluster = cluster;
    }
}

compiled with -c -O3 -fno-signed-zeros, does this:

$ /home/dcb/gcc/results/bin/gcc -c -O3 -fno-signed-zeros bug732.c
bug732.c: In function ‘update_r_k’:
bug732.c:3:26: warning: implicit declaration of function
‘distance3d_sqr_pt4d_pt4d’ [-Wimplicit-function-declaration]
    3 |   double curr_distance = distance3d_sqr_pt4d_pt4d();
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~
during GIMPLE pass: ifcvt
bug732.c:2:6: internal compiler error: in fold_cond_expr_with_comparison, at
fold-const.c:5944

Bug seems to first appear sometime between git hash 607c558804f70af2
and 5b1ce655b2504004

Reply via email to