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

            Bug ID: 105041
           Summary: '-fcompare-debug' failure w/ -mcpu=power6 -O2
                    -fharden-compares -frename-registers
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: compare-debug-failure
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: powerpc-*-linux-gnu

Created attachment 52678
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52678&action=edit
gkd diff

gcc 12.0.1 20220320 snapshot (g:6f30c4cd38b8385d62358065d795df590e752d6e) fails
-fcompare-debug check when compiling the following testcase w/ -mcpu=power6 -O2
-fcompare-debug -fharden-compares -frename-registers:

double m;
int n;

unsigned int
foo (unsigned int x, int y)
{
  long long int a = y, b = !a;
  int c = 0;

  if (b != x)
    while ((int) m == a)
      {
        c = a;
        a = 0;
        x = 0;
      }

  n = b = y;

  return x + c;
}

% powerpc-e300c3-linux-gnu-gcc-12.0.1 -mcpu=power6 -O2 -fcompare-debug
-fharden-compares -frename-registers -c ck9whkva.c
powerpc-e300c3-linux-gnu-gcc-12.0.1: error: ck9whkva.c: '-fcompare-debug'
failure

gkd diff attached.

I suppose it is really a duplicate of PR104771.

Reply via email to