https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124549
Bug ID: 124549
Summary: riscv64: false positive -Walloc-size-larger-than= with
int multiplication
Product: gcc
Version: 13.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: Haixiao.Yan.CN at windriver dot com
Target Milestone: ---
Created attachment 63953
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63953&action=edit
cpumap_repro.i
$ riscv64-linux-gnu-gcc-13 -O2 -O6 -Werror -Wall -S cpumap_repro.i
/buildarea5/hyan-cn/project_lts24-world/build-perf-riscv64/tmp-glibc/work/qemuriscv64-wrs-linux/perf/1.0/perf-1.0/tools/lib/perf/cpumap.c:
In function ‘perf_cpu_map__merge’:
/buildarea5/hyan-cn/project_lts24-world/build-perf-riscv64/tmp-glibc/work/qemuriscv64-wrs-linux/perf/1.0/perf-1.0/tools/lib/perf/cpumap.c:422:13:
error: argument 1 range [18446744065119617024, 18446744073709551612] exceeds
maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=]
In file included from
/buildarea5/hyan-cn/project_lts24-world/build-perf-riscv64/tmp-glibc/work/qemuriscv64-wrs-linux/perf/1.0/perf-1.0/tools/lib/perf/cpumap.c:3:
/buildarea5/hyan-cn/project_lts24-world/build-perf-riscv64/tmp-glibc/work/qemuriscv64-wrs-linux/perf/1.0/recipe-sysroot/usr/include/stdlib.h:672:14:
note: in a call to allocation function ‘malloc’ declared here
cc1: all warnings being treated as errors
Reproduce:
riscv64-linux-gnu-gcc-13 -O2 -O6 -Werror -Wall -S cpumap_repro.i
Known to fail: 13.3.0, 13.4.0
Known to work: 11.5.0, 12.5.0, 14.3.0, 15.2.0