[Bug c/80806] gcc does not warn if local array is memset only

2022-01-26 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80806 Martin Sebor changed: What|Removed |Added Assignee|msebor at gcc dot gnu.org |unassigned at gcc dot gnu.org

[Bug c/72783] Fortify scanf %s, %[ conversion specifiers

2022-01-26 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72783 Martin Sebor changed: What|Removed |Added Assignee|msebor at gcc dot gnu.org |unassigned at gcc dot gnu.org

[Bug c++/70816] bogus error __builtin_strcmp is not a constant expression in a constexpr function

2022-01-26 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70816 Martin Sebor changed: What|Removed |Added Assignee|msebor at gcc dot gnu.org |unassigned at gcc dot gnu.org

[Bug c++/70019] VLA size overflow not detected

2022-01-26 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70019 Martin Sebor changed: What|Removed |Added Assignee|msebor at gcc dot gnu.org |unassigned at gcc dot gnu.org

[Bug c++/68047] diagnose placement new with misaligned buffer

2022-01-26 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68047 Martin Sebor changed: What|Removed |Added Status|ASSIGNED|NEW Assignee|msebor at gcc dot

[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2022-01-26 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159 Martin Sebor changed: What|Removed |Added Assignee|msebor at gcc dot gnu.org |unassigned at gcc dot gnu.org

[Bug tree-optimization/18487] Warnings for pure and const functions that are not actually pure or const

2022-01-26 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18487 Martin Sebor changed: What|Removed |Added Status|ASSIGNED|NEW Assignee|msebor at gcc dot

[Bug tree-optimization/104215] bogus -Wuse-after-free=3 due to forwprop moving a pointer test after realloc

2022-01-26 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104215 --- Comment #7 from Martin Sebor --- The kernel false positive is discussed in bug 104069 comment 13. I don't think it's related to this issue but you're of course right that this warning isn't immune to false positives. That's true for all wa

[Bug tree-optimization/104215] bogus -Wuse-after-free=3 due to forwprop moving a pointer test after realloc

2022-01-25 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104215 --- Comment #5 from Martin Sebor --- To "use" means to evaluate. The strict C semantics are that the realloc() argument becomes indeterminate after the function has returned non-null, whether or not the returned pointer is the same as the argum

[Bug tree-optimization/104203] [12 Regressions] huge compile-time regression in pointer_query since r12-6606-g9d6a0f388eb048f8

2022-01-25 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104203 Martin Sebor changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED

[Bug middle-end/104232] [12 Regression] spurious -Wuse-after-free after conditional free

2022-01-25 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104232 Martin Sebor changed: What|Removed |Added URL|https://bugzilla.redhat.com |https://bugzilla.redhat.com

[Bug middle-end/104232] [12 Regression] spurious -Wuse-after-free after conditional free

2022-01-25 Thread msebor at gcc dot gnu.org via Gcc-bugs
gcc dot gnu.org |msebor at gcc dot gnu.org Ever confirmed|0 |1 Status|UNCONFIRMED |ASSIGNED Keywords||diagnostic Last reconfirmed||2022-01-25 URL

[Bug middle-end/104232] New: spurious -Wuse-after-free after conditional free

2022-01-25 Thread msebor at gcc dot gnu.org via Gcc-bugs
: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- The test case below was reduced from https://bugzilla.redhat.com/show_bug.cgi?id=2043195 (it's been greatly simplified). It shows a false positive caused b

[Bug tree-optimization/104215] bogus -Wuse-after-free=3 due to forwprop moving a pointer test after realloc

2022-01-25 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104215 --- Comment #3 from Martin Sebor --- I meant to say "C++ made it implementation-defined to use a pointer made indeterminate by the pointee's lifetime having ended."

[Bug tree-optimization/104215] bogus -Wuse-after-free=3 due to forwprop moving a pointer test after realloc

2022-01-25 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104215 --- Comment #2 from Martin Sebor --- The use in your example is undefined in C (as is any other use of an indeterminate pointer value). C++ made using pointers made it implementation-defined a few years ago while still allowing for it to crash,

[Bug driver/104216] New: -w overrides #pragma GCC diagnostic which overrides -Werror

2022-01-24 Thread msebor at gcc dot gnu.org via Gcc-bugs
Priority: P3 Component: driver Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- In the Warning options section the manual says this about -w and -Werror: -w Inhibit all warning messages. -Werror Make all

[Bug tree-optimization/104203] [12 Regressions] huge compile-time regression in pointer_query since r12-6606-g9d6a0f388eb048f8

2022-01-24 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104203 Martin Sebor changed: What|Removed |Added Summary|[12 Regressions] huge |[12 Regressions] huge

[Bug tree-optimization/104215] New: bogus -Wuse-after-free=3 due to forwprop moving a pointer test after realloc

2022-01-24 Thread msebor at gcc dot gnu.org via Gcc-bugs
: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- This is to make a record of the false positive. I don't expect GCC to avoid reordering the statement

[Bug tree-optimization/101831] [11/12 Regression] Spurious maybe-uninitialized warning on std::array::size

2022-01-24 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101831 Martin Sebor changed: What|Removed |Added Known to fail||11.2.0, 12.0 Summary|Spurious

[Bug target/104213] [12 Regression] bogus use-after-free in virtual dtor with -ffat-lto-objects on ARM

2022-01-24 Thread msebor at gcc dot gnu.org via Gcc-bugs
||msebor at gcc dot gnu.org --- Comment #4 from Martin Sebor --- The warning points out the return statement in the dtor below, so it's doing what it's been taught to do. I'm not sure why a dtor would have a return type other than void or why it would need to return t

[Bug tree-optimization/104203] [12 Regressions] huge compile-time regression since r12-6606-g9d6a0f388eb048f8

2022-01-24 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104203 --- Comment #9 from Martin Sebor --- The underlying problem is that when the pointer_query class fails to determine the pointer provenance for an SSA variable it doesn't update the cache, matter how laborious the computation was. The next time

[Bug tree-optimization/104203] [12 Regressions] huge compile-time regression since r12-6606-g9d6a0f388eb048f8

2022-01-24 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104203 --- Comment #7 from Martin Sebor --- (In reply to Richard Biener from comment #5) ... > Martin, can you add a new timevar to timevar.def and use that in > pass_data_waccess please? Will do. The bottleneck is the PHI handling in the access warn

[Bug tree-optimization/104203] [12 Regressions] huge compile-time regression since r12-6606-g9d6a0f388eb048f8

2022-01-24 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104203 Martin Sebor changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot gnu.org

[Bug tree-optimization/103121] [12 Regression] Warnings in cp/optimize.c causing build failure

2022-01-21 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103121 --- Comment #31 from Martin Sebor --- I believe I understand what both of you are saying and (also) that the cache behaves correctly. It stores offsets based on the pointer definition statements. Here's a test that I think reproduces the condi

[Bug tree-optimization/104165] [12 Regression] -Warray-bounds for unreachable code inlined from std::sort()

2022-01-21 Thread msebor at gcc dot gnu.org via Gcc-bugs
||msebor at gcc dot gnu.org Last reconfirmed||2022-01-21 Blocks||56456 Summary|[12 Regression] Incorrectly |[12 Regression] |identifying array bounds|-Warray-bounds for

[Bug tree-optimization/103121] [12 Regression] Warnings in cp/optimize.c causing build failure

2022-01-21 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103121 --- Comment #29 from Martin Sebor --- >From memory: At use1 the cache is empty so go and find its definition and record the offset at that point, with the pointer addition as the context. And at use2 we look up the same offset. So use1 won't r

[Bug c++/104148] [11/12 Regression] -Wformat warning no longer warns about () wrapped args since r11-2457

2022-01-20 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104148 --- Comment #3 from Martin Sebor --- I suspect the unwanted suppression is because check_function_argument_recurse() calls warning_suppressed_p (param) instead of warning_suppressed_p (param, ) (for each of the warnings it checks). So any other

[Bug tree-optimization/103121] [12 Regression] Warnings in cp/optimize.c causing build failure

2022-01-20 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103121 --- Comment #26 from Martin Sebor --- (In reply to Andrew Macleod from comment #25) ... > I also don't get the warning anymore on trunk. > > Is there still an issue here? The strlen pass was converted to Ranger in g:6b8b959675a3e14cfdd2145bd62

[Bug libstdc++/100516] [11/12 Regression] Unexpected -Wstringop-overread in deque initialization from empty initializer_list

2022-01-20 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100516 Martin Sebor changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill

[Bug tree-optimization/104119] [12 Regression] unexpected -Wformat-overflow after strlen in ILP32 since Ranger integration

2022-01-19 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104119 Martin Sebor changed: What|Removed |Added Keywords||patch --- Comment #4 from Martin Sebor

[Bug c++/104134] Bootstrap on FreeBSD files compiling gcc/cp/error.cc

2022-01-19 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104134 --- Comment #9 from Martin Sebor --- The code uses the M_ macro: pp_printf (pp, M_(""), variety); on my machine it expands into: pp_printf (pp, ((cxx_pp)->translate_identifiers ? gettext ("") : ("")), variety); and GCC doesn't warn most

[Bug bootstrap/104135] [12 Regression] -Werror=format-diag breaks rtl checking bootstrap

2022-01-19 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104135 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org --- Comment

[Bug c++/104134] Bootstrap on FreeBSD files compiling gcc/cp/error.cc

2022-01-19 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104134 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org --- Comment

[Bug middle-end/104069] -Werror=use-after-free false positive on elfutils-0.186

2022-01-19 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104069 --- Comment #20 from Martin Sebor --- This warning, like all others, is meant to help find common bugs in ordinary code. It shouldn't be expected to reflect implementation-defined behavior or to be free of false positives. Tricky code that tri

[Bug middle-end/104069] -Werror=use-after-free false positive on elfutils-0.186

2022-01-19 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104069 --- Comment #17 from Martin Sebor --- Having spent some time trying to understand the function I think the following simplification should capture its intent. It compiles without warnings at all levels: void *xrealloc (void *ptr, size_t size)

[Bug middle-end/104069] -Werror=use-after-free false positive on elfutils-0.186

2022-01-19 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104069 --- Comment #14 from Martin Sebor --- Removing the test for !size from the first conditional avoids the warning. I don't fully understand what the code tries to do but the following avoids it at -O2 (only): void *xrealloc (void *ptr, int size)

[Bug middle-end/104069] -Werror=use-after-free false positive on elfutils-0.186

2022-01-19 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104069 --- Comment #13 from Martin Sebor --- I confused things (including myself) yesterday, sorry. Let me try again, with just the -O2 behavior for the test case in comment #2: void *xrealloc (void *ptr, int size) { void *ret = __builtin_realloc (

[Bug tree-optimization/104119] [12 Regression] unexpected -Wformat-overflow after strlen in ILP32 since Ranger integration

2022-01-19 Thread msebor at gcc dot gnu.org via Gcc-bugs
gnu.org |msebor at gcc dot gnu.org --- Comment #3 from Martin Sebor --- Let me try to handle this for GCC 12.

[Bug tree-optimization/104119] unexpected -Wformat-overflow after strlen in ILP32 since Ranger integration

2022-01-19 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104119 Martin Sebor changed: What|Removed |Added Keywords||diagnostic Summary|Wrong

[Bug tree-optimization/96367] bogus -Wformat-truncation in ILP32

2022-01-19 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96367 Martin Sebor changed: What|Removed |Added Known to fail|11.0|11.2.0, 12.0 --- Comment #2 from Martin S

[Bug tree-optimization/93518] missing warning on a possible overflow by sprintf %s with an allocated argument

2022-01-19 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93518 Martin Sebor changed: What|Removed |Added Last reconfirmed|2021-12-23 00:00:00 |2022-1-19 Known to fail|

[Bug c/89161] Bogus -Wformat-overflow warning with value range known

2022-01-19 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89161 Martin Sebor changed: What|Removed |Added Known to fail|10.0|10.3.0, 11.2.0, 12.0 Last reconfirmed|2

[Bug middle-end/104076] bogus -Wdangling-pointer on a conditional

2022-01-18 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104076 --- Comment #3 from Martin Sebor --- Looking at the IL before r12-6694 I'm not sure I see what could be done to keep the warning from triggering but maybe someone has an idea for a solution I'm not seeing, in case this comes back with a differen

[Bug middle-end/104103] [12 regression] many excess errors from g++.dg/asan/asan_test.C after r12-6606

2022-01-18 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104103 --- Comment #3 from Martin Sebor --- (In reply to seurer from comment #2) The warning for gcc/testsuite/gcc.dg/torture/pr57147-2.c looks correct. The g_return_jmp_buf variable has zero size but it's being passed to a function declared to take

[Bug middle-end/104076] bogus -Wdangling-pointer on a conditional

2022-01-18 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104076 --- Comment #1 from Martin Sebor --- This instance of the warning has disappeared with r12-6694.

[Bug middle-end/104069] -Werror=use-after-free false positive on elfutils-0.186

2022-01-18 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104069 --- Comment #9 from Martin Sebor --- My mistake, a PHI is an OR of its operands, not an AND. With that, the IL doesn't rule out that the subsequent realloc() call isn't made with the argument to a prior successful realloc(). So for the more in

[Bug middle-end/104069] -Werror=use-after-free false positive on elfutils-0.186

2022-01-18 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104069 Martin Sebor changed: What|Removed |Added Component|tree-optimization |middle-end --- Comment #7 from Martin Se

[Bug tree-optimization/104069] -Werror=use-after-free false positive on elfutils-0.186

2022-01-18 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104069 Martin Sebor changed: What|Removed |Added CC||amacleod at redhat dot com --- Comment #

[Bug middle-end/104077] bogus/missing -Wdangling-pointer

2022-01-18 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104077 Bug 104077 depends on bug 104082, which changed state. Bug 104082 Summary: Wdangling-pointer: 2 * false positive ? https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104082 What|Removed |Added ---

[Bug tree-optimization/104082] Wdangling-pointer: 2 * false positive ?

2022-01-18 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104082 Martin Sebor changed: What|Removed |Added Resolution|--- |INVALID Blocks|

[Bug middle-end/103483] [12 regression] context-sensitive ranges change triggers stringop-overread

2022-01-17 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103483 --- Comment #17 from Martin Sebor --- Jaosn: this is how all middle-end warnings have always behaved. They trigger on invalid statements present in the IL. A statement is considered invalid when any of its operands is out of bounds or in some

[Bug middle-end/104077] bogus/missing -Wdangling-pointer

2022-01-17 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104077 Martin Sebor changed: What|Removed |Added Last reconfirmed||2022-01-17 Alias|

[Bug middle-end/104077] New: bogus/missing -Wdangling-pointer

2022-01-17 Thread msebor at gcc dot gnu.org via Gcc-bugs
Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- This meta-bug tracks false positives and negatives in the middle-end -Wdangling-pointer, new in GCC 12.

[Bug middle-end/104076] bogus -Wdangling-pointer on a conditional

2022-01-17 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104076 Martin Sebor changed: What|Removed |Added Ever confirmed|0 |1 Status|UNCONFIRMED

[Bug middle-end/104076] New: bogus -Wdangling-pointer on a conditional

2022-01-17 Thread msebor at gcc dot gnu.org via Gcc-bugs
: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- As reported in https://gcc.gnu.org/pipermail/gcc-patches/2022-January/588620.html, the new -Wdangling-pointer issues a false positive for the following test case: $ cat t.C

[Bug middle-end/104075] bogus/missing -Wuse-after-free

2022-01-17 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104075 Martin Sebor changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug middle-end/104075] New: bogus/missing -Wuse-after-free

2022-01-17 Thread msebor at gcc dot gnu.org via Gcc-bugs
Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- This meta-bug tracks false positives and negatives in the middle-end -Wuse-after-free, new in GCC 12 (unrelated to -Wanalyzer-use-after-free).

[Bug tree-optimization/104069] -Werror=use-after-free false positive on elfutils-0.186

2022-01-17 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104069 --- Comment #4 from Martin Sebor --- Actually, this is already supposed to be handled but the code is not effective due to a typo. This fixes it: diff --git a/gcc/gimple-ssa-warn-access.cc b/gcc/gimple-ssa-warn-access.cc index f639807a78a..f95

[Bug tree-optimization/104069] -Werror=use-after-free false positive on elfutils-0.186

2022-01-17 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104069 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org

[Bug c++/84544] Missing warning when returning a reference to internal variable inside a lambda

2022-01-15 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84544 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org --- Comment #3

[Bug c++/49974] missing -Wreturn-local-addr for indirectly returning reference to local/temporary

2022-01-15 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49974 --- Comment #18 from Martin Sebor --- This detection is partially implemented in GCC 12 by the -Wdnagling-pointer: $ cat pr49974.C && gcc -O -S -Wall pr49974.C struct X { }; inline const X& f(const X& r) { return r; } const X& g() { X x;

[Bug tree-optimization/90905] missing -Wreturn-local-addr returning a local std::string::c_str()

2022-01-15 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90905 --- Comment #9 from Martin Sebor --- This still isn't diagnosed by GCC 12 even with its -Wuse-after-free and -Wdangling-pointer.

[Bug tree-optimization/90906] diagnose returning pointers to freed memory

2022-01-15 Thread msebor at gcc dot gnu.org via Gcc-bugs
|--- |FIXED Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot gnu.org Target Milestone|--- |12.0 --- Comment #4 from Martin Sebor --- Implemented in GCC 12 (r12-6605) as -Wuse-after-free.

[Bug tree-optimization/80532] warning on pointer access after free

2022-01-15 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80532 Martin Sebor changed: What|Removed |Added Status|ASSIGNED|RESOLVED Target Milestone|---

[Bug middle-end/63272] GCC should warn when using pointer to dead scoped variable within the same function

2022-01-15 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63272 Martin Sebor changed: What|Removed |Added Target Milestone|--- |12.0 Status|ASSIGNED

[Bug tree-optimization/104038] ranger infinite loop on a PHI statement while building Clang

2022-01-15 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104038 Martin Sebor changed: What|Removed |Added Summary|ranger infinite loop on a |ranger infinite loop on a

[Bug tree-optimization/104038] ranger infinite loop on a PHI statement

2022-01-14 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104038 --- Comment #4 from Martin Sebor --- The problem is reproducible with -O1 and above. To confirm it's not infinite recursion I let the process run for about an hour before killing it. Memory consumption seems to slowly but steadily increase as

[Bug tree-optimization/104038] ranger infinite loop on a PHI statement

2022-01-14 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104038 --- Comment #3 from Martin Sebor --- The basic block being analyzed is bb 2 in clang::clangd::stdlib::initialize(). What's unusual about it is that it's a sequence of 2464 assignments like so: : SymCount_21 = 0; SymCount_22 = SymCount_21 + 1;

[Bug tree-optimization/104038] ranger infinite loop on a PHI statement

2022-01-14 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104038 --- Comment #2 from Martin Sebor --- Created attachment 52198 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52198&action=edit Unreduced test case. The attached translation unit reproduces the infinite loop.

[Bug tree-optimization/104038] ranger infinite loop on a PHI statement

2022-01-14 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104038 --- Comment #1 from Martin Sebor --- Created attachment 52197 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52197&action=edit Patch needed to trigger the infinite loop. When the attached patch is applied the infinite loop can be triggere

[Bug tree-optimization/104038] New: ranger infinite loop on a PHI statement

2022-01-14 Thread msebor at gcc dot gnu.org via Gcc-bugs
-optimization Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- I'm debugging what looks like an infinite loop deep in Ranger. Interrupting with SIGABRT the cc1plus process while under GDB produces the backtrace below. Retu

[Bug tree-optimization/88443] [meta-bug] bogus/missing -Wstringop-overflow warnings

2022-01-14 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443 Bug 88443 depends on bug 101475, which changed state. Bug 101475 Summary: missing -Wstringop-overflow storing a compound literal https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101475 What|Removed |Added --

[Bug middle-end/101475] missing -Wstringop-overflow storing a compound literal

2022-01-14 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101475 Martin Sebor changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug tree-optimization/104012] [12 regression] -Wformat-truncation warnings not taking previous length check into account

2022-01-14 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104012 --- Comment #6 from Martin Sebor --- To expand a bit on the fuzziness at level 1. The logic is documented under the -Wformat-overflow warning like so: Numeric arguments that are known to be bounded to a subrange of their type, or string argu

[Bug tree-optimization/85741] [meta-bug] bogus/missing -Wformat-overflow

2022-01-14 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85741 Bug 85741 depends on bug 104012, which changed state. Bug 104012 Summary: [12 regression] -Wformat-truncation warnings not taking previous length check into account https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104012 What|Removed

[Bug tree-optimization/104012] [12 regression] -Wformat-truncation warnings not taking previous length check into account

2022-01-14 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104012 Martin Sebor changed: What|Removed |Added Resolution|--- |INVALID Blocks|

[Bug tree-optimization/104017] unexpeted -Warray-bounds popping a fixed number of std::deque elements

2022-01-13 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104017 --- Comment #1 from Martin Sebor --- The warning triggers for the clobber statement in bb 43 below. _236 is assumed to point to the beginning of the block of 512 bytes allocated by new, so subtracting a positive integer from it or adding one in

[Bug middle-end/104017] New: unexpeted -Warray-bounds popping a fixed number of std::deque elements

2022-01-13 Thread msebor at gcc dot gnu.org via Gcc-bugs
Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- I got the following report in my private mail. I file it here for reference (and my analysis). Although the warning isn&#

[Bug tree-optimization/104012] [12 regression] -Wformat-truncation warnings not taking previous length check into account

2022-01-13 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104012 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org --- Comment

[Bug middle-end/103993] -Wismatched-new-delete due to difference in inlining decisions

2022-01-12 Thread msebor at gcc dot gnu.org via Gcc-bugs
||msebor at gcc dot gnu.org See Also||https://gcc.gnu.org/bugzill ||a/show_bug.cgi?id=100861 Summary|Incorrect error generated |-Wismatched-new-delete due |by

[Bug c/81453] relational expression involving null pointer not diagnosed with -Wall

2022-01-10 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81453 Martin Sebor changed: What|Removed |Added Keywords||patch --- Comment #4 from Martin Sebor -

[Bug middle-end/93848] missing -Warray-bounds warning for array subscript 1 is outside array bounds

2022-01-10 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93848 --- Comment #14 from Martin Sebor --- Created attachment 52156 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52156&action=edit Updated patch. The attached patch is an updated version that fixes a few ICEs. It's not in the archives becaus

[Bug c++/103945] No warning for ordered comparison of function pointers ?

2022-01-10 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103945 --- Comment #5 from Martin Sebor --- (The patch review was never finished.)

[Bug c++/103945] No warning for ordered comparison of function pointers ?

2022-01-10 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103945 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org --- Comment

[Bug middle-end/93848] missing -Warray-bounds warning for array subscript 1 is outside array bounds

2022-01-10 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93848 --- Comment #13 from Martin Sebor --- The patch submitted (but not approved) for GCC 11: https://gcc.gnu.org/pipermail/gcc-patches/2020-November/558775.html

[Bug analyzer/103940] RFE: check -Wanalyzer-tainted-size on external fns with attribute ((access)) with a size-index

2022-01-07 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103940 --- Comment #2 from Martin Sebor --- It makes sense to me, David.

[Bug tree-optimization/103835] bogus sprintf warnings due to missing strlen propagation

2022-01-06 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103835 --- Comment #5 from Martin Sebor --- It's the same cause. When the -Wformat-overflow and -truncation warnings are unable to compute the exact length of a string argument to a directive like %s they use the size of the array the string is stored

[Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]

2022-01-05 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758 --- Comment #10 from Martin Sebor --- The diagnostic kinds in the call: warning_at (loc, OPT_Wpragmas, "missing [error|warning|ignored|push|pop|ignored_attributes]" " after %<#pragma GCC diagnostic%>");

[Bug tree-optimization/103835] bogus sprintf warnings due to missing strlen propagation

2022-01-04 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103835 Martin Sebor changed: What|Removed |Added Summary|Bogus sprintf warnings |bogus sprintf warnings due

[Bug tree-optimization/103858] [12 Regression] strlen() implementation is optimized into a call to strlen() at -O2, causing infinite recursion

2022-01-04 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103858 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org --- Comment

[Bug tree-optimization/85741] [meta-bug] bogus/missing -Wformat-overflow

2022-01-04 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85741 Bug 85741 depends on bug 92943, which changed state. Bug 92943 Summary: missing -Wformat-overflow with an allocated buffer with non-constant size in known range https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92943 What|Removed

[Bug tree-optimization/92943] missing -Wformat-overflow with an allocated buffer with non-constant size in known range

2022-01-04 Thread msebor at gcc dot gnu.org via Gcc-bugs
|--- |FIXED Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot gnu.org Status|NEW |RESOLVED --- Comment #2 from Martin Sebor --- Fixed by r11-5622 (AKA PR middle-end/97373).

[Bug middle-end/103372] Warning on failure order defaulting to SEQ_CST if not a compile time constant

2022-01-04 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103372 Martin Sebor changed: What|Removed |Added Known to fail||10.2.0, 11.2.0, 4.9.4,

[Bug middle-end/103372] Warning on failure order defaulting to SEQ_CST if not a compile time constant

2022-01-04 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103372 Bug 103372 depends on bug 99612, which changed state. Bug 99612 Summary: Remove "#pragma GCC system_header" from atomic file to warn on incorrect memory order https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99612 What|Removed

[Bug middle-end/99612] Remove "#pragma GCC system_header" from atomic file to warn on incorrect memory order

2022-01-04 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99612 Martin Sebor changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED

[Bug testsuite/103907] many C++ test failures with --target_board=unix/-m32

2022-01-04 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103907 Martin Sebor changed: What|Removed |Added Resolution|--- |INVALID Status|WAITING

[Bug testsuite/103907] New: many C++ test failures with --target_board=unix/-m32

2022-01-04 Thread msebor at gcc dot gnu.org via Gcc-bugs
Component: testsuite Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- I see a large number of C++ tests fail on x86_64-linux with --target_board=unix/-m32 (but not with -m64). I don't recall having those failures before wit

[Bug c++/84573] missing warning on an uninstantiated function template returning T with no return statement

2021-12-17 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84573 Martin Sebor changed: What|Removed |Added Status|WAITING |NEW --- Comment #4 from Martin Sebor ---

[Bug tree-optimization/88443] [meta-bug] bogus/missing -Wstringop-overflow warnings

2021-12-17 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443 Bug 88443 depends on bug 102944, which changed state. Bug 102944 Summary: Many gcc.dg/Wstringop-overflow-*.c failures https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102944 What|Removed |Added -

[Bug testsuite/102944] Many gcc.dg/Wstringop-overflow-*.c failures

2021-12-17 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102944 Martin Sebor changed: What|Removed |Added Status|WAITING |RESOLVED Resolution|---

<    1   2   3   4   5   6   7   8   9   10   >