Commit 8e23a99
middle-end: Fix spurious -Walloc-size-larger-than warning during LTO [PR106409]
The implementation of -Walloc-size-larger-than has logic to avoid issuing
the warning for ::operator new[] calls emitted by the C++ front end, which
otherwise produce known false positives. The logic for suppressing the
warning only activates in the C++ front end, and so it does not prevent the
LTO front end from issuing the warning. Fix by applying the logic in all
cases.
gcc/ChangeLog:
PR tree-optimization/106409
* gimple-ssa-warn-access.cc (maybe_warn_alloc_args_overflow): Adjust
comment for clarity, and augment check to work in LTO as well.
gcc/testsuite/ChangeLog:
PR tree-optimization/106409
* g++.dg/lto/pr106409_0.C: New test.1 parent ffa9842 commit 8e23a99
File tree
2 files changed
+28
-5
lines changed- gcc
- testsuite/g++.dg/lto
2 files changed
+28
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2334 | 2334 | | |
2335 | 2335 | | |
2336 | 2336 | | |
2337 | | - | |
2338 | | - | |
2339 | | - | |
2340 | | - | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
2341 | 2342 | | |
2342 | 2343 | | |
2343 | 2344 | | |
2344 | | - | |
2345 | 2345 | | |
2346 | 2346 | | |
2347 | 2347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
0 commit comments