Bug 82500 - [8 Regression] UBSAN in gcc/profile-count.h:190:14: runtime error: signed integer overflow: 1073741823 * 10000 cannot be represented in type 'int'
Summary: [8 Regression] UBSAN in gcc/profile-count.h:190:14: runtime error: signed int...
Status: RESOLVED DUPLICATE of bug 81318
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 8.0
: P3 normal
Target Milestone: 8.0
Assignee: Martin Liška
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-10 07:52 UTC by Martin Liška
Modified: 2017-10-10 10:26 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 8.0
Last reconfirmed: 2017-10-10 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2017-10-10 07:52:36 UTC
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.
Comment 1 Martin Liška 2017-10-10 10:26:44 UTC
Dup.

*** This bug has been marked as a duplicate of bug 81318 ***