[Bug tree-optimization/103456] [12 Regression] gcc/gcc.c:9502:8: runtime error: load of address 0x0000009f5037 with insufficient space for an object of type 'const char' since r12-5548-g4a2007594cff78

2021-12-01 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103456 Siddhesh Poyarekar changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED

[Bug tree-optimization/103759] [12 Regression] memcpy-chk failure for 32 bits

2021-12-17 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103759 Siddhesh Poyarekar changed: What|Removed |Added Status|NEW |ASSIGNED

[Bug tree-optimization/103759] [12 Regression] memcpy-chk failure for 32 bits

2021-12-17 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103759 --- Comment #2 from Siddhesh Poyarekar --- I've posted a candidate fix: https://patchwork.sourceware.org/project/gcc/patch/20211217212347.72617-1-siddh...@gotplt.org/

[Bug tree-optimization/89748] missing _FORTIFY_SOURCE protection due to stpcpy folding

2022-01-04 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89748 Siddhesh Poyarekar changed: What|Removed |Added CC||siddhesh at gcc dot gnu.org

[Bug middle-end/70090] add non-constant variant of __builtin_object_size for _FORTIFY_SOURCE and -fsanitize=object-size

2022-01-04 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70090 Siddhesh Poyarekar changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |siddhesh at gcc dot gnu.org

[Bug middle-end/77608] missing protection on trivially detectable runtime buffer overflow

2022-01-04 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77608 Siddhesh Poyarekar changed: What|Removed |Added CC||siddhesh at gcc dot gnu.org

[Bug tree-optimization/103456] [12 Regression] gcc/gcc.c:9502:8: runtime error: load of address 0x0000009f5037 with insufficient space for an object of type 'const char' since r12-5548-g4a2007594cff78

2021-11-29 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103456 Siddhesh Poyarekar changed: What|Removed |Added CC|siddhesh at redhat dot com | Status|NEW

[Bug target/103613] New: microblaze: ICE in reload pass when building PIE

2021-12-07 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103613 Bug ID: 103613 Summary: microblaze: ICE in reload pass when building PIE Product: gcc Version: 11.2.1 Status: UNCONFIRMED Severity: normal Priority: P3

[Bug driver/103646] New: gcc driver breaks asm ("ebp")

2021-12-10 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103646 Bug ID: 103646 Summary: gcc driver breaks asm ("ebp") Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: driver

[Bug target/103646] -O2 -mstackrealign and inline-asm with ebp

2021-12-10 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103646 Siddhesh Poyarekar changed: What|Removed |Added Resolution|--- |INVALID

[Bug testsuite/103522] New test case gcc.dg/ubsan/pr103456.c fails in r12-5649

2021-12-01 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103522 Siddhesh Poyarekar changed: What|Removed |Added Ever confirmed|0 |1 Assignee|unassigned

[Bug ipa/101941] [12 Regression] Linux kernel build failure due to retaining fnsplit fragment with __attribute__((__error__))

2022-01-13 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101941 --- Comment #29 from Siddhesh Poyarekar --- (In reply to Andrew Pinski from comment #28) > (In reply to Martin Liška from comment #26) > > that started with r12-6030-g422f9eb7011b76c1. > > Please file that bug separately and it might be

[Bug tree-optimization/104009] r12-6030-g422f9eb7011b76c1 breaks kernel build

2022-01-13 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104009 Siddhesh Poyarekar changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |siddhesh at gcc dot

[Bug tree-optimization/104009] New: r12-6030-g422f9eb7011b76c1 breaks kernel build

2022-01-13 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104009 Bug ID: 104009 Summary: r12-6030-g422f9eb7011b76c1 breaks kernel build Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component:

[Bug tree-optimization/104009] [12 Regression] r12-6030-g422f9eb7011b76c1 breaks kernel build

2022-01-14 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104009 Siddhesh Poyarekar changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED

[Bug tree-optimization/103961] [12 Regression] gcc-12 apparently miscompiles libcap's cap_to_text() function since r12-6030-g422f9eb7011b76c1

2022-01-11 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103961 Siddhesh Poyarekar changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |siddhesh at gcc dot

[Bug tree-optimization/103961] [12 Regression] gcc-12 apparently miscompiles libcap's cap_to_text() function since r12-6030-g422f9eb7011b76c1

2022-01-11 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103961 --- Comment #16 from Siddhesh Poyarekar --- Should be fixed with that patch. May I close this or wait for confirmation from the reporter?

[Bug middle-end/77608] missing protection on trivially detectable runtime buffer overflow

2022-01-11 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77608 --- Comment #8 from Siddhesh Poyarekar --- The test case for pr 103961 exposed a flaw in my patch, where assuming wholesize isn't always safe or at least would need more careful consideration. I need to think this through some more.

[Bug tree-optimization/104942] [12 Regression] ICE in size_for_offset, at tree-object-size.cc:352 since r12-6482-g06bc1b0c539e3a60

2022-03-16 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104942 Siddhesh Poyarekar changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED

[Bug tree-optimization/104941] [12 Regression] ICE error: invalid (pointer) operands ‘minus_expr’ since r12-6482-g06bc1b0c539e3a60

2022-03-16 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104941 Siddhesh Poyarekar changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED

[Bug tree-optimization/104941] ICE error: invalid (pointer) operands ‘minus_expr’ since r12-6482-g06bc1b0c539e3a60

2022-03-15 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104941 Siddhesh Poyarekar changed: What|Removed |Added Status|NEW |ASSIGNED

[Bug tree-optimization/104942] ICE in size_for_offset, at tree-object-size.cc:352 since r12-6482-g06bc1b0c539e3a60

2022-03-15 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104942 Siddhesh Poyarekar changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |siddhesh at gcc dot

[Bug tree-optimization/104964] Wrong *** buffer overflow detected ***: terminated - acl

2022-03-17 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104964 Siddhesh Poyarekar changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |siddhesh at gcc dot

[Bug middle-end/104854] -Wstringop-overread should not warn for strnlen, strndup and strncmp

2022-03-14 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104854 --- Comment #6 from Siddhesh Poyarekar --- (In reply to Martin Sebor from comment #5) > It would be useful to separate these warnings into multiple levels: level 1 > for invalid code, and higher levels for suspicious (or pointless) code, >

[Bug middle-end/104854] -Wstringop-overread should not warn for strnlen, strndup and strncmp

2022-03-14 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104854 --- Comment #8 from Siddhesh Poyarekar --- (In reply to Martin Sebor from comment #7) > Moving warnings into the analyzer and scaling it up to be able to run by > default, during development, sounds like a good long-term plan. Until that

[Bug middle-end/104854] -Wstringop-overread should not warn for strnlen, strndup and strncmp

2022-03-09 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104854 Siddhesh Poyarekar changed: What|Removed |Added Summary|-Wstringop-overread should |-Wstringop-overread should

[Bug middle-end/104854] New: [11 Regression] -Wstringop-overread should not warn for strnlen and strndup

2022-03-09 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104854 Bug ID: 104854 Summary: [11 Regression] -Wstringop-overread should not warn for strnlen and strndup Product: gcc Version: 11.2.1 Status: UNCONFIRMED Severity:

[Bug middle-end/104854] [11/12 Regression] -Wstringop-overread should not warn for strnlen and strndup

2022-03-09 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104854 --- Comment #2 from Siddhesh Poyarekar --- (In reply to David Malcolm from comment #1) > Compiler Explorer link for the above (with -fanalyzer -Wall > -Wstringop-overread -O2; -O2 seems to be needed to trigger it): Ah yes, sorry, I pasted an

[Bug tree-optimization/104970] [12 Regression] ICE in execute_todo, at passes.cc:2133 since r12-6480-gea19c8f33a3a8d2b

2022-03-22 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104970 --- Comment #8 from Siddhesh Poyarekar --- (In reply to Martin Sebor from comment #7) > The dollar sign in the internal attr_access string implies a VLA bound and > the attr_access::vla_bounds() function queries the VLA bounds. That should >

[Bug tree-optimization/104964] Wrong *** buffer overflow detected ***: terminated - acl

2022-03-25 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104964 --- Comment #13 from Siddhesh Poyarekar --- It's not really a regression AFAICT, it's only more visible with __bdos because non-constant offsets don't stop it. Also the problem is only with subobjects (hence limited to _FORTIFY_SOURCE > 1 for

[Bug tree-optimization/104970] [12 Regression] ICE in execute_todo, at passes.cc:2133 since r12-6480-gea19c8f33a3a8d2b

2022-03-24 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104970 Siddhesh Poyarekar changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug tree-optimization/104964] Wrong *** buffer overflow detected ***: terminated - acl

2022-03-28 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104964 Siddhesh Poyarekar changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug tree-optimization/105078] Maybe wrong *** buffer overflow detected ***: terminated with -D_FORTIFY_SOURCE

2022-03-28 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105078 --- Comment #5 from Siddhesh Poyarekar --- (In reply to Martin Liška from comment #4) > Note the libQt6 version of the function looking approximately like this: > This doesn't warn anymore (and doesn't crash either) because objsz cannot get

[Bug tree-optimization/105078] Maybe wrong *** buffer overflow detected ***: terminated with -D_FORTIFY_SOURCE

2022-03-28 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105078 --- Comment #1 from Siddhesh Poyarekar --- With gcc12: Computing maximum subobject size for _11: Visiting use-def links for _11 Visiting use-def links for _10 Computing maximum object size for header_12: Visiting use-def links for header_12

[Bug tree-optimization/104969] Likely a false positive of -D_FORTIFY_SOURCE=3

2022-03-22 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104969 Siddhesh Poyarekar changed: What|Removed |Added See Also||https://sourceware.org/bugz

[Bug tree-optimization/105078] Maybe wrong *** buffer overflow detected ***: terminated with -D_FORTIFY_SOURCE

2022-03-28 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105078 Siddhesh Poyarekar changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug tree-optimization/104964] Wrong *** buffer overflow detected ***: terminated - acl

2022-03-25 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104964 Siddhesh Poyarekar changed: What|Removed |Added Status|NEW |ASSIGNED --- Comment #10 from

[Bug tree-optimization/104964] Wrong *** buffer overflow detected ***: terminated - acl

2022-03-25 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104964 --- Comment #11 from Siddhesh Poyarekar --- (In reply to Siddhesh Poyarekar from comment #10) > OK, I have a representative reproducer, which TBH is not too different from > the one you posted, just that it succeeds with __builtin_object_size

[Bug middle-end/77608] missing protection on trivially detectable runtime buffer overflow

2022-01-06 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77608 Siddhesh Poyarekar changed: What|Removed |Added Status|NEW |ASSIGNED --- Comment #7 from

[Bug tree-optimization/105217] Likely wrong code with -D_FORTIFY_SOURCE=3 since r12-6482-g06bc1b0c539e3a60

2022-04-12 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105217 Siddhesh Poyarekar changed: What|Removed |Added CC||jakub at gcc dot gnu.org ---

[Bug tree-optimization/105217] Likely wrong code with -D_FORTIFY_SOURCE=3

2022-04-11 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105217 Siddhesh Poyarekar changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |siddhesh at gcc dot

[Bug tree-optimization/105217] Likely wrong code with -D_FORTIFY_SOURCE=3 since r12-6482-g06bc1b0c539e3a60

2022-04-11 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105217 --- Comment #2 from Siddhesh Poyarekar --- OK, taking a closer look, it looks like clang simply fails to fortify fread (probably due to https://reviews.llvm.org/D109967 or something similar). Modifying the code to use __fread_chk directly:

[Bug ipa/96503] attribute alloc_size effect lost after inlining

2023-10-25 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96503 --- Comment #8 from Siddhesh Poyarekar --- (In reply to Martin Uecker from comment #7) > For __builtin_with_access we probably only want to allow > reducing the object size, while the 'extend_size' workaround  > used by systemd (cf comment #4)

[Bug ipa/96503] attribute alloc_size effect lost after inlining

2023-10-25 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96503 --- Comment #5 from Siddhesh Poyarekar --- This could work for alloc_size, but not quite for access. pointer_with_size (or __builtin_with_size as you suggested in that thread) would need to express access semantics too, to be able to express

[Bug ipa/96503] attribute alloc_size effect lost after inlining

2023-10-25 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96503 --- Comment #6 from Siddhesh Poyarekar --- So basically, __builtin_with_access(void *ptr, size_t size, int access) where access == -1: Unknown access semantics 0: none 1: read_only 2: write_only 3: read_write should address both access and

[Bug tree-optimization/105217] Likely wrong code with -D_FORTIFY_SOURCE=3 since r12-6482-g06bc1b0c539e3a60

2022-04-19 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105217 --- Comment #5 from Siddhesh Poyarekar --- (In reply to Jakub Jelinek from comment #4) > Then there is the case where we can clearly see that the pointer from malloc > is passed to realloc or can trace it to such easily. I'd say in that case >

[Bug tree-optimization/104969] Likely a false positive of -D_FORTIFY_SOURCE=3

2022-03-17 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104969 --- Comment #2 from Siddhesh Poyarekar --- (In reply to Martin Liška from comment #0) > The original code is defective a bit as it wrongly assumes that > (char*)str + (2 * i) is at maximum 'len' big. It's actually len - (2 * i) > big. But it

[Bug tree-optimization/104970] ICE in execute_todo, at passes.cc:2133 since r12-6480-gea19c8f33a3a8d2b

2022-03-17 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104970 Siddhesh Poyarekar changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |siddhesh at gcc dot

[Bug tree-optimization/105736] [12 Regression] ICE in force_gimple_operand_1, at gimplify-me.cc:79 since r13-222-g28896b38fabce818

2022-05-26 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105736 Siddhesh Poyarekar changed: What|Removed |Added Status|NEW |ASSIGNED

[Bug middle-end/101836] __builtin_object_size(P->M, 1) where M is an array and the last member of a struct fails

2022-05-26 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836 --- Comment #7 from Siddhesh Poyarekar --- I couldn't work on -fstrict-flex-arrays then, sorry. I do have it in my plan for gcc 13, but I'll admit it's not on the very top of my list of things to do this year. If you or anyone else needs a

[Bug tree-optimization/105736] [12 Regression] ICE in force_gimple_operand_1, at gimplify-me.cc:79 since r13-222-g28896b38fabce818

2022-05-26 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105736 --- Comment #2 from Siddhesh Poyarekar --- OK, so the fix is pretty straightforward; error_mark_node escapes through as a return in ADDR_EXPR object size computations. I want to get a reproducer independent of ubsan though so that it's

[Bug middle-end/105709] FORTIFY_SOURCE=3 (*** buffer overflow detected ***: terminated) on Qt

2022-05-23 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105709 --- Comment #9 from Siddhesh Poyarekar --- >From a quick check of non-reduced-qt.cxx, clang appears to fail to fortify the readlink function, which may explain why you see the failure with gcc but not clang. Also the reduced reproducer in

[Bug middle-end/101836] __builtin_object_size(P->M, 1) where M is an array and the last member of a struct fails

2022-06-13 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836 --- Comment #22 from Siddhesh Poyarekar --- (In reply to Kees Cook from comment #21) > How about "-fnot-flex-arrays=N" to mean "trailing arrays with N or more > elements will NOT be treated like a flex array"? > > Then code with sockaddr can

[Bug tree-optimization/105736] [12/13 Regression] ICE in force_gimple_operand_1, at gimplify-me.cc:79 since r13-222-g28896b38fabce818

2022-06-14 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105736 --- Comment #3 from Siddhesh Poyarekar --- Here we go, I'll put it into builtin-dynamic-object-size-0.c, bootstrap and post a patch. struct TV4 { __attribute__((vector_size (sizeof (int) * 4))) int v; }; struct TV4 val3; int * f1 (struct

[Bug tree-optimization/97185] inconsistent builtin elimination for impossible range

2022-06-14 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97185 --- Comment #1 from Siddhesh Poyarekar --- While the missed optimization ought to be fixed, what's the value of -Wstringop-* warning on an impossible range, i.e. when low > high? Shouldn't it just bail out silently if it detects an impossible

[Bug middle-end/101836] __builtin_object_size(P->M, 1) where M is an array and the last member of a struct fails

2022-06-13 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836 --- Comment #23 from Siddhesh Poyarekar --- (In reply to Siddhesh Poyarekar from comment #22) > An arbitrary N will only make it abuse-friendly and potentially mask bugs. > IMO if we choose to make multiple levels here it should only be >

[Bug middle-end/101836] __builtin_object_size(P->M, 1) where M is an array and the last member of a struct fails

2022-06-14 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836 --- Comment #26 from Siddhesh Poyarekar --- (In reply to qinzhao from comment #25) > So, based on all the discussion so far, how about the following: > > ** add the following gcc option: > > -fstrict-flex-arrays=[0|1|2|3] > > when

[Bug tree-optimization/97185] inconsistent builtin elimination for impossible range

2022-06-15 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97185 --- Comment #3 from Siddhesh Poyarekar --- (In reply to Martin Sebor from comment #2) > There's a heuristic for ranges of allocation sizes to exclude zero > (size_range_flags) that comes into play here. The actual range isn't > "impossible" in

[Bug tree-optimization/105736] [12/13 Regression] ICE in force_gimple_operand_1, at gimplify-me.cc:79 since r13-222-g28896b38fabce818

2022-06-23 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105736 Siddhesh Poyarekar changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED

[Bug middle-end/105566] [13 regression] ICE in gfortran.dg/ubsan/bind-c-intent-out-2.f90 after r13-222-g28896b38fabce8

2022-05-11 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105566 Siddhesh Poyarekar changed: What|Removed |Added Resolution|--- |FIXED

[Bug middle-end/70090] add non-constant variant of __builtin_object_size for _FORTIFY_SOURCE and -fsanitize=object-size

2022-05-10 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70090 Siddhesh Poyarekar changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug tree-optimization/107038] [13 Regression] Bogus -Wstringop-overflow= since r13-2789-gb40b3035879cf695

2022-09-26 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107038 --- Comment #1 from Siddhesh Poyarekar --- recvd is uninitialized and it seems to be preventing optimization of the fortify macro one way or for some reason. I can take a look at why the condition does not get folded away but a reproducer

[Bug tree-optimization/107038] [13 Regression] Bogus -Wstringop-overflow= since r13-2789-gb40b3035879cf695

2022-09-26 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107038 --- Comment #4 from Siddhesh Poyarekar --- (In reply to Martin Liška from comment #2) > > I assume this is elfutils #29614? > > Yes. > > Please take a look at the original unreduced testcase I attached here. That looks like unpatched

[Bug tree-optimization/107038] [13 Regression] Bogus -Wstringop-overflow= since r13-2789-gb40b3035879cf695

2022-09-26 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107038 --- Comment #5 from Siddhesh Poyarekar --- (In reply to Siddhesh Poyarekar from comment #4) > (In reply to Martin Liška from comment #2) > > > I assume this is elfutils #29614? > > > > Yes. > > > > Please take a look at the original unreduced

[Bug tree-optimization/107038] Bogus -Wstringop-overflow in dead code

2022-10-07 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107038 Siddhesh Poyarekar changed: What|Removed |Added Last reconfirmed||2022-10-07

[Bug tree-optimization/107038] Bogus -Wstringop-overflow in dead code

2022-10-07 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107038 --- Comment #8 from Siddhesh Poyarekar --- I forgot to mention that I've been building with: gcc/cc1 -o /dev/null ../bogus-stringop-overflow.i -O2 -Werror=stringop-overflow -quiet to reproduce the warning: ../bogus-stringop-overflow.i: In

[Bug tree-optimization/107038] Bogus -Wstringop-overflow in dead code

2022-10-07 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107038 Siddhesh Poyarekar changed: What|Removed |Added Summary|[13 Regression] Bogus |Bogus -Wstringop-overflow

[Bug tree-optimization/105043] Documentation for __builtin_object_size and other Object Size checking builtin functions should mention - D_FORTIFY_SOURCE

2023-01-03 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105043 Siddhesh Poyarekar changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED

[Bug tree-optimization/108398] New: tree-object-size trips up with pointer arithmetic if an intermediate result is an invalid pointer

2023-01-13 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108398 Bug ID: 108398 Summary: tree-object-size trips up with pointer arithmetic if an intermediate result is an invalid pointer Product: gcc Version: 13.0 Status: UNCONFIRMED

[Bug tree-optimization/108398] tree-object-size trips up with pointer arithmetic if an intermediate result is an invalid pointer

2023-01-13 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108398 --- Comment #2 from Siddhesh Poyarekar --- Yeah, I've been ping-ponging about the validity too, which is why I filed a bug to get some consensus position. I suppose if we don't treat it as a bug, should we try and support it in cases we can by

[Bug tree-optimization/108398] tree-object-size trips up with pointer arithmetic if an intermediate result is an invalid pointer

2023-01-13 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108398 --- Comment #3 from Siddhesh Poyarekar --- Oops, sorry I messed up the reproducer, here's the correct one. The principles don't really change though: unsigned steps[2]; int main(void) { unsigned n_steps = sizeof (steps) / sizeof

[Bug c/77650] struct with a nested flexible array followed by another member accepted

2022-12-02 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77650 Siddhesh Poyarekar changed: What|Removed |Added CC||siddhesh at gcc dot gnu.org ---

[Bug c/107951] Invalid flexible array use not detected in nested structs by the C frontend

2022-12-02 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107951 Siddhesh Poyarekar changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug tree-optimization/105043] Documentation for __builtin_object_size and other Object Size checking builtin functions should mention - D_FORTIFY_SOURCE

2022-12-08 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105043 Siddhesh Poyarekar changed: What|Removed |Added Status|NEW |ASSIGNED

[Bug tree-optimization/107952] tree-object-size: inconsistent size for flexible arrays nested in structs

2022-12-05 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107952 --- Comment #5 from Siddhesh Poyarekar --- (In reply to rguent...@suse.de from comment #4) > Does it allow the nesting when nested in a union? data[] cannot be nested directly in a union (i.e. union { char d; char data[]; } is invalid) but

[Bug tree-optimization/107952] tree-object-size: inconsistent size for flexible arrays nested in structs

2022-12-05 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107952 --- Comment #2 from Siddhesh Poyarekar --- The standard does not allow the nesting, but gcc supports it as an extension. The middle end does see the array as a flex array correctly, but tree-object-size doesn't seem to do the right thing

[Bug c/107951] New: Invalid flexible array use not detected in nested structs by the C frontend

2022-12-02 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107951 Bug ID: 107951 Summary: Invalid flexible array use not detected in nested structs by the C frontend Product: gcc Version: unknown Status: UNCONFIRMED

[Bug tree-optimization/107952] New: tree-object-size: inconsistent size for flexible arrays nested in structs

2022-12-02 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107952 Bug ID: 107952 Summary: tree-object-size: inconsistent size for flexible arrays nested in structs Product: gcc Version: 13.0 Status: UNCONFIRMED Severity:

[Bug tree-optimization/108398] tree-object-size trips up with pointer arithmetic if an intermediate result is an invalid pointer

2023-01-13 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108398 --- Comment #5 from Siddhesh Poyarekar --- Ack, I had a thinko with unsigned steps[] = {1, 1}; because in that case too n_steps doesn't get decremented, resulting in OOB access. I'm going to look at the original report[1] to see if the test

[Bug tree-optimization/108398] tree-object-size trips up with pointer arithmetic if an intermediate result is an invalid pointer

2023-01-13 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108398 Siddhesh Poyarekar changed: What|Removed |Added Resolution|--- |INVALID

[Bug tree-optimization/108398] tree-object-size trips up with pointer arithmetic if an intermediate result is an invalid pointer

2023-01-13 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108398 --- Comment #7 from Siddhesh Poyarekar --- Thanks, is that from the code in prima[1] or the Red Hat bugzilla report? The latter is undefined as per the above discussion. [1] https://github.com/dk/Prima/issues/78

[Bug tree-optimization/108522] New: [Regression 12/13] ICE in tree-object-size when struct has VLA

2023-01-24 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108522 Bug ID: 108522 Summary: [Regression 12/13] ICE in tree-object-size when struct has VLA Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal

[Bug tree-optimization/108522] [Regression 12/13] ICE in tree-object-size when struct has VLA

2023-01-24 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108522 Siddhesh Poyarekar changed: What|Removed |Added See Also||https://bugzilla.redhat.com

[Bug tree-optimization/107952] tree-object-size: inconsistent size for flexible arrays nested in structs

2023-01-25 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107952 --- Comment #12 from Siddhesh Poyarekar --- (In reply to qinzhao from comment #7) > (In reply to Richard Biener from comment #1) > > GCC considered this as a flex-array. > > do you mean for the following example: > > typedef struct { >

[Bug tree-optimization/107952] tree-object-size: inconsistent size for flexible arrays nested in structs

2023-01-25 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107952 --- Comment #14 from Siddhesh Poyarekar --- (In reply to Qing Zhao from comment #13) > > > > The first is handled by the function just fine, > > No, even the first case is not recognized by the current > “array_ref_flexible_size_p”, it’s not

[Bug tree-optimization/107952] tree-object-size: inconsistent size for flexible arrays nested in structs

2023-01-25 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107952 --- Comment #16 from Siddhesh Poyarekar --- (In reply to Qing Zhao from comment #15) > Since S2.flex is not an “array_ref”, it’s correct for > array_ref_fleixble_size_p to return false for it, I think. > We might add a new utility routine to

[Bug tree-optimization/107952] tree-object-size: inconsistent size for flexible arrays nested in structs

2023-01-23 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107952 --- Comment #8 from Siddhesh Poyarekar --- (In reply to qinzhao from comment #7) > (In reply to Richard Biener from comment #1) > > GCC considered this as a flex-array. > > do you mean for the following example: > > typedef struct { > char

[Bug c/108896] provide "element_count" attribute to give more context to __builtin_dynamic_object_size() and -fsanitize=bounds

2023-03-06 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108896 --- Comment #22 from Siddhesh Poyarekar --- (In reply to Martin Uecker from comment #20) > > I haven't seen comments on Kees's first example, where "malloc" returns an > > "__alloc_size" hint that's lost when "p" is returned from the function

[Bug libgcc/109270] ssp/ssp.h should be adapted to use __builtin_dynamic_object_size()

2023-03-24 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109270 Siddhesh Poyarekar changed: What|Removed |Added Ever confirmed|0 |1 Last reconfirmed|

[Bug middle-end/109557] __builtin_dynamic_object_size() does not work for simple testing case

2023-04-19 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109557 --- Comment #1 from Siddhesh Poyarekar --- The __bdos call itself cannot succeed in main() because it cannot see the allocation in store(). One way it could succeed is if store() was inlined, but for some reason it doesn't, even if you make

[Bug middle-end/109557] __builtin_dynamic_object_size() does not work for simple testing case

2023-04-19 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109557 --- Comment #2 from Siddhesh Poyarekar --- (In reply to qinzhao from comment #0) > I am wondering for > p.3_1 = p; > _2 = __builtin_object_size (p.3_1, 0); > > why the size of p.3_1 cannot use the TYPE_SIZE of the pointee of p when its > size

[Bug middle-end/109557] __builtin_dynamic_object_size() does not work for simple testing case

2023-04-19 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109557 Siddhesh Poyarekar changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug middle-end/109557] __builtin_dynamic_object_size() does not work for simple testing case

2023-04-19 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109557 --- Comment #4 from Siddhesh Poyarekar --- (In reply to Martin Uecker from comment #3) > I general the pointer could point to the first object of an array that has > more elements, or to an object of a different type. How so? p in comment 0

[Bug tree-optimization/109334] tree-object-size: Improve size computation in arguments

2023-03-31 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109334 --- Comment #2 from Siddhesh Poyarekar --- That seems OK; I had added that to be conservative since I really only intended to add support for the access attribute back then and not the implicit attributes. Could you please post that on the ML

[Bug tree-optimization/104970] [12 Regression] ICE in execute_todo, at passes.cc:2133 since r12-6480-gea19c8f33a3a8d2b

2023-03-29 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104970 --- Comment #14 from Siddhesh Poyarekar --- (In reply to Martin Uecker from comment #13) > This fix seem too radical. It now prevents this from working even when there > is an explicit attribute but there is also a VLA bound. Also I think it >

[Bug tree-optimization/109334] New: tree-object-size: Improve size computation in arguments

2023-03-29 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109334 Bug ID: 109334 Summary: tree-object-size: Improve size computation in arguments Product: gcc Version: 13.0 Status: UNCONFIRMED Keywords: ice-on-valid-code

[Bug sanitizer/109308] False positive store to address 0x62600000016c with insufficient space for an object of type 'int' since r12-6030-g422f9eb7011b76c1

2023-03-28 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109308 --- Comment #5 from Siddhesh Poyarekar --- This kinda has happened before: https://github.com/Perl/perl5/issues/20678 Should we keep this bug open for the message, which is obviously wrong?

[Bug tree-optimization/108522] [12 Regression] ICE in tree-object-size when struct has VLA

2023-02-07 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108522 Siddhesh Poyarekar changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED

[Bug testsuite/110763] FAIL: gcc.dg/ubsan/object-size-dyn.c -O2 execution test

2023-07-26 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110763 Siddhesh Poyarekar changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug tree-optimization/110373] New: __builtin_object_size does not recognize subarrays in multi-dimensional arrays

2023-06-22 Thread siddhesh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110373 Bug ID: 110373 Summary: __builtin_object_size does not recognize subarrays in multi-dimensional arrays Product: gcc Version: 13.0 Status: UNCONFIRMED

  1   2   >