[Bug c/71613] Useful warnings silenced when macros from system headers are used

2024-05-15 Thread tavianator at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71613 Tavian Barnes changed: What|Removed |Added CC||tavianator at gmail dot com --- Comment

[Bug sanitizer/113430] Trivial program segfaults intermittently with ASAN with large CONFIG_ARCH_MMAP_RND_BITS in kernel configuration

2024-01-17 Thread tavianator at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113430 --- Comment #5 from Tavian Barnes --- (In reply to Xi Ruoyao from comment #3) > Updated the title to make it more precise. > > Note that even with Linux 6.7 the default value of CONFIG_ARCH_MMAP_RND_BITS > is still 28 (32 is set by some distro

[Bug sanitizer/113430] New: Trivial program segfaults intermittently with ASAN since Linux 6.7

2024-01-16 Thread tavianator at gmail dot com via Gcc-bugs
Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: tavianator at gmail dot com CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org

[Bug middle-end/112748] memmove(ptr, ptr, n) call optimized out even at -O0 with -fsanitize=undefined

2023-11-28 Thread tavianator at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112748 --- Comment #2 from Tavian Barnes --- (In reply to Andrew Pinski from comment #1) > Does -fsanitize=address remove it? Yes, it's still removed with -fsanitize=address. While ASAN is necessary to check that the memory is really allocated, UBSAN

[Bug c/112748] New: memmove(ptr, ptr, n) call optimized out even at -O0 with -fsanitize=undefined

2023-11-28 Thread tavianator at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: tavianator at gmail dot com Target Milestone: --- This is counter-productive, as I wrote the memmove() specifically to get the sanitizers to check that ptr really points to

[Bug middle-end/94787] Failure to detect single bit popcount pattern

2023-11-15 Thread tavianator at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94787 Tavian Barnes changed: What|Removed |Added CC||tavianator at gmail dot com --- Comment

[Bug target/106952] Missed optimization: x < y ? x : y not lowered to minss

2022-09-15 Thread tavianator at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106952 --- Comment #2 from Tavian Barnes --- (In reply to Alexander Monakov from comment #1) > Note, your 'max' function is the same as 'min' (the issue remains with that > corrected). Whoops, thanks. Also I just noticed that GCC 12.2 does better (bu

[Bug target/106952] New: Missed optimization: x < y ? x : y not lowered to minss

2022-09-15 Thread tavianator at gmail dot com via Gcc-bugs
mal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: tavianator at gmail dot com Target Milestone: --- Created attachment 53580 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53580&action=edit Assembly from gcc -O3 -S bug.c The

[Bug tree-optimization/65752] Too strong optimizations int -> pointer casts

2020-08-04 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65752 Tavian Barnes changed: What|Removed |Added CC||tavianator at gmail dot com --- Comment

[Bug middle-end/93742] New: Optimization request: pattern-match typical addition overflow checks

2020-02-14 Thread tavianator at gmail dot com
Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: tavianator at gmail dot com Target Milestone: --- It would be nice if GCC could pattern-match the typical pattern for overflow-safe addition and optimize it to just branch on

[Bug tree-optimization/93681] Wrong optimization: instability of x87 floating-point results leads to nonsense

2020-02-11 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93681 Tavian Barnes changed: What|Removed |Added CC||tavianator at gmail dot com --- Comment

[Bug tree-optimization/90766] strlen(a + i) missing range for arrays of unknown bound with strings of known length and variable i

2019-06-06 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90766 Tavian Barnes changed: What|Removed |Added CC||tavianator at gmail dot com --- Comment

[Bug libstdc++/90246] std::bad_variant_access messages are not useful

2019-04-25 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90246 Tavian Barnes changed: What|Removed |Added CC||tavianator at gmail dot com --- Comment

[Bug c++/90205] Wformat-signedness detects %d and suggests %d fixit hint

2019-04-23 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90205 Tavian Barnes changed: What|Removed |Added CC||tavianator at gmail dot com --- Comment

[Bug c/87806] Option -Wall should warn about unused structs, typdefs, enums, etc

2018-10-31 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87806 Tavian Barnes changed: What|Removed |Added CC||tavianator at gmail dot com --- Comment

[Bug middle-end/87647] New: ICE on valid code in decode_addr_const, at varasm.c:2958

2018-10-18 Thread tavianator at gmail dot com
Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: tavianator at gmail dot com Target Milestone: --- $ cat test.c struct a { }; struct a *const b = &(struct a){}; int main() { struct { char *s; struct a *t; } a[] = {&

[Bug tree-optimization/86029] gcc -O3 make very slow product

2018-06-04 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86029 --- Comment #5 from Tavian Barnes --- (In reply to Zsolt from comment #3) > What is the difference between gcc's and clang's __mulsc3? The important difference is that Clang (and GCC trunk) expand the fastpath inline, and fall back on __mulsc3 f

[Bug tree-optimization/86029] gcc -O3 make very slow product

2018-06-01 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86029 Tavian Barnes changed: What|Removed |Added CC||tavianator at gmail dot com --- Comment

[Bug c++/85958] Make const qualifier error clear

2018-05-30 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85958 Tavian Barnes changed: What|Removed |Added CC||tavianator at gmail dot com --- Comment

[Bug preprocessor/81515] C pre-processor allows invalid words

2017-07-22 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81515 Tavian Barnes changed: What|Removed |Added CC||tavianator at gmail dot com --- Comment

[Bug middle-end/61118] Spurious -Wclobbered warning generated by gcc 4.9.0 for pthread_cleanup_push

2017-03-20 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61118 --- Comment #10 from Tavian Barnes --- > I think it is - __cancel_arg is assigned inside a while loop Specifically a do { } while(0); loop, which obviously has only one iteration.

[Bug middle-end/61118] Spurious -Wclobbered warning generated by gcc 4.9.0 for pthread_cleanup_push

2017-03-19 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61118 --- Comment #7 from Tavian Barnes --- > the warning is issued for variables which are alive after return from longjmp > but not marked as volatile. Such variables will have undefined value > according to C standard > (http://pubs.opengroup.org

[Bug c/78584] Bug in GCC argument parser expandargv

2016-11-29 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78584 Tavian Barnes changed: What|Removed |Added CC||tavianator at gmail dot com --- Comment

[Bug middle-end/71177] Spurious -Waggressive-loop-optimizations warning

2016-05-19 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71177 --- Comment #4 from Tavian Barnes --- > I remember seeing a similar bugreport. PR57199 is very similar, pretty much an exact dupe actually.

[Bug middle-end/71177] Spurious -Waggressive-loop-optimizations warning

2016-05-18 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71177 Tavian Barnes changed: What|Removed |Added Attachment #38516|0 |1 is obsolete|

[Bug middle-end/71177] New: [6 Regression] Spurious -Waggressive-loop-optimizations warning

2016-05-18 Thread tavianator at gmail dot com
Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: tavianator at gmail dot com Target Milestone: --- Created attachment 38516 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38516&action=edit Reduced testcase The fo

[Bug middle-end/71002] [6/7 Regression] -fstrict-aliasing breaks Boost's short string optimization implementation

2016-05-10 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71002 --- Comment #11 from Tavian Barnes --- Yeah I reported the Boost bug as https://svn.boost.org/trac/boost/ticket/12183.

[Bug middle-end/71002] [6/7 Regression] -fstrict-aliasing breaks Boost's short string optimization implementation

2016-05-09 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71002 --- Comment #5 from Tavian Barnes --- > But if it is not POD then assuming it gets copied correctly when > init-constructing a POD union where they placed such object is > an interesting assumption... Hrm? They seem to always copy it manually w

[Bug middle-end/71002] [6/7 Regression] -fstrict-aliasing breaks Boost's short string optimization implementation

2016-05-09 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71002 --- Comment #3 from Tavian Barnes --- Because their long_t is not POD. I don't know why that is though. It could be POD if they removed the default/copy constructors and assignment operator. Actually they're probably worried about custom alloc

[Bug middle-end/71002] New: [6 Regression] -fstrict-aliasing breaks Boost's short string optimization implementation

2016-05-07 Thread tavianator at gmail dot com
IRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: tavianator at gmail dot com Target Milestone: --- Created attachment 38438 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38438&action=

[Bug middle-end/70054] New: GCC 6 gives a strict-aliasing warning on use of std::aligned_storage

2016-03-02 Thread tavianator at gmail dot com
Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: tavianator at gmail dot com Target Milestone: --- GCC 6 warns on this code; GCC 5 didn't. boost::container::string uses this pattern as part of its SSO implementation, s

[Bug c++/64372] Spurious warning with throw in ternary operator returning const reference

2014-12-21 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64372 --- Comment #4 from Tavian Barnes --- I meant to include -std=c++11 in the OP, it still happens with that flag set. Good suggestion for the replacement though. The actual code was closer to i < length ? a[i] : throw ... but I guess that can bec

[Bug c++/64372] New: Spurious warning with throw in ternary operator returning const reference

2014-12-21 Thread tavianator at gmail dot com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tavianator at gmail dot com The following program produces a spurious warning: $ cat ternary-warning.cpp const char& foo(const char* ptr) { return ptr ? *ptr : throw ptr; }

[Bug c++/63723] Narrowing conversion allowed in braced init list in SFINAE context

2014-12-18 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63723 --- Comment #8 from Tavian Barnes --- Actually it is a regression: according to http://gcc.godbolt.org/, GCC 4.6.4 compiled it correctly with -std=c++0x and typedef decltype(helper(0)) type; instead of using type = decltype(helper(0)); wh

[Bug tree-optimization/64308] Missed optimization: 64-bit divide used when 32-bit divide would work

2014-12-16 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64308 --- Comment #3 from Tavian Barnes --- @Richard Biener: Yes the range for _16 could be [0, 4294967294]. Why can't VRP can't assume division by zero doesn't occur? If it can then it could say anything mod [a, b] fits in [0, b - 1]. That's a reas

[Bug tree-optimization/64308] New: Missed optimization: 64-bit divide used when 32-bit divide would work

2014-12-14 Thread tavianator at gmail dot com
Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: tavianator at gmail dot com Created attachment 34280 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34280&action=edit Test case The following is a fairly

[Bug c++/57510] initializer_list memory leak

2014-12-08 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57510 --- Comment #4 from Tavian Barnes --- I have a testing tool that automatically inserts operator new failures, to help test exception safety and check for leaks. This bug causes all kinds of spurious failures that I have to work around, since any

[Bug libstdc++/63840] New: std::function copy constructor deletes an uninitialized pointer if new fails

2014-11-12 Thread tavianator at gmail dot com
: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: tavianator at gmail dot com Created attachment 33953 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33953&action=edit Reproducer std::function's copy

[Bug c++/63723] Narrowing conversion allowed in braced init list in SFINAE context

2014-11-04 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63723 --- Comment #4 from Tavian Barnes --- Still happens with 4.9.2 though. Is a backport of the fix possible?

[Bug c++/63723] Narrowing conversion allowed in braced init list in SFINAE context

2014-11-03 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63723 --- Comment #2 from Tavian Barnes --- It's decltype(requires_conversion({std::declval()})). Not sure why it says .

[Bug c++/63723] New: Narrowing conversion allowed in braced init list in SFINAE context

2014-11-03 Thread tavianator at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tavianator at gmail dot com Created attachment 33877 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33877&action=edit Preprocessed source GCC allows narrowing convers

[Bug tree-optimization/63537] [4.8/4.9/5 Regression] Missed optimization: Loop unrolling adds extra copy when returning aggregate

2014-10-15 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63537 --- Comment #2 from Tavian Barnes --- Is it possible to make SRA work even if the loop isn't unrolled? If the array size is increased to 4 then -O2 doesn't unroll the loop at all, resulting in: movq%rdi, %rax xorl%edx, %edx .L3:

[Bug tree-optimization/63537] New: Missed optimization: Loop unrolling adds extra copy when returning aggregate

2014-10-14 Thread tavianator at gmail dot com
: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: tavianator at gmail dot com Created attachment 33715 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33715&action=edit Reproducer At -O2 and above on

[Bug c++/63323] New: "confused by earlier errors, bailing out" with no other errors

2014-09-21 Thread tavianator at gmail dot com
ty: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tavianator at gmail dot com Created attachment 33529 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33529&action=edit Preprocessed source The following file giv

[Bug c/61957] New: Wrong -Warray-bounds warning depending on parameter types

2014-07-29 Thread tavianator at gmail dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: tavianator at gmail dot com Created attachment 33205 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33205&action=edit Test case On x86-64 Linux, the attached testcase produces the du

[Bug c/61118] Spurious -Wclobbered warning generated by gcc 4.9.0 for pthread_cleanup_push

2014-05-08 Thread tavianator at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61118 --- Comment #1 from Tavian Barnes --- Created attachment 32763 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32763&action=edit Preprocessed source file

[Bug c/61118] New: Spurious -Wclobbered warning generated by gcc 4.9.0 for pthread_cleanup_push

2014-05-08 Thread tavianator at gmail dot com
: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: tavianator at gmail dot com Created attachment 32762 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32762&action=edit Source file On gcc 4.9.0 (but not on 4.8.2 or

[Bug c/43904] Wrong code with -foptimize-sibling-calls and memcpy on x86_64

2010-04-26 Thread tavianator at gmail dot com
--- Comment #2 from tavianator at gmail dot com 2010-04-26 23:47 --- Created an attachment (id=20497) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20497&action=view) Full testcase Proper output: Stored: 0x40071c Got:0x40071c Hello world! Output with -O -foptimize-

[Bug c/43904] New: Wrong code with -foptimize-sibling-calls and memcpy on x86_64

2010-04-26 Thread tavianator at gmail dot com
Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tavianator at gmail dot com GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu