[Bug middle-end/87256] New: hppa spends huge amount of time in synth_mult()

slyfox at inbox dot ru gcc-bugzilla@gcc.gnu.org
Sat Sep 8 18:31:00 GMT 2018


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

            Bug ID: 87256
           Summary: hppa spends huge amount of time in synth_mult()
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at inbox dot ru
  Target Milestone: ---

Created attachment 44672
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44672&action=edit
bug.c

Performance hog initially noticed on http://www.xxhash.com project
(xxhash-0.6.5). When being compiled on hppa it takes hours for gcc. When being
compiled on x86_64 it takes seconds.

Minimal example:

// $ time /usr/bin/hppa2.0-unknown-linux-gnu-gcc -O2 -fomit-frame-pointer -c -o
bug.o bug.C
// real    0m9,051s
// user    0m9,040s
// sys     0m0,009s
void a (long);
void b (long long c, int s)
{
  switch (s)
    {
    case 4:
      c = 0;
    case 6:
      c = c * 13;
    case 8:
      c = c + 19;
    case 28:
      c = c * 0x85ebca77c2b2ae63LLU;
      c = c * 9650029242287828579LL;
      c = c * 9650029242287828579LL;
      c = c * 9650029242287828579LL; /* this line adds 2 seconds: 7->9 */
      c = c * 9650029242287828579LL; /* this line adds 2 seconds: 9->11 */
      a (c);
    }
}


More information about the Gcc-bugs mailing list