This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/82500] New: [8 Regression] UBSAN in gcc/profile-count.h:190:14: runtime error: signed integer overflow: 1073741823 * 10000 cannot be represented in type 'int'


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

            Bug ID: 82500
           Summary: [8 Regression] UBSAN in gcc/profile-count.h:190:14:
                    runtime error: signed integer overflow: 1073741823 *
                    10000 cannot be represented in type 'int'
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: hubicka at ucw dot cz
  Target Milestone: ---

Having bootstrap-ubsan, one can see:

$ cat /tmp/ubsan.i
int d();
int e();

__attribute__((__cold__)) int a();
int b() { a(); }
int c() {
  b();
  if (d())
    e();
}

$ gcc -O2 /tmp/ubsan.i -c
../../gcc/profile-count.h:190:14: runtime error: signed integer overflow:
1073741823 * 10000 cannot be represented in type 'int'
../../gcc/profile-count.h:190:14: runtime error: signed integer overflow:
1073741823 * 10000 cannot be represented in type 'int'

I'll fix it.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]