[Bug c++/99429] ICE for bool return from <=>

2021-03-06 Thread msharov at users dot sourceforge.net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99429 Mike Sharov changed: What|Removed |Added Attachment #50315|0 |1 is obsolete|

[Bug c++/99429] New: ICE for bool return from <=>

2021-03-06 Thread msharov at users dot sourceforge.net via Gcc-bugs
ent: c++ Assignee: unassigned at gcc dot gnu.org Reporter: msharov at users dot sourceforge.net Target Milestone: --- Created attachment 50315 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50315=edit std::strong_ordering and incorrect duration code When erronously declaring <

[Bug c/98404] New: Compiler emits unexpected function call that may cause security problems

2020-12-20 Thread msharov at users dot sourceforge.net via Gcc-bugs
: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: msharov at users dot sourceforge.net Target Milestone: --- int rotate_argv (const char** argv, int first, int mid, int end) { const char** p = argv+first; int n1 = mid

[Bug tree-optimization/93896] New: Store merging uses SSE only for trivial types

2020-02-23 Thread msharov at users dot sourceforge.net
: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: msharov at users dot sourceforge.net Target Milestone: --- struct M { constexpr M() :p{},sz{},cz{}{} public: char* p; unsigned sz; unsigned cap; }; struct A { M a,b,c; A(); }; A::A() :a{},b{},c

[Bug rtl-optimization/91482] New: __builtin_assume_aligned should not break write combining

2019-08-18 Thread msharov at users dot sourceforge.net
Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: msharov at users dot sourceforge.net Target Milestone: --- void write64 (void* p) { unsigned* p1 = (unsigned*) __builtin_assume_aligned (p, 8); *p1++ = 0; unsigned* p2

[Bug c++/85875] New: -Weffc++ can't understand auto return values

2018-05-22 Thread msharov at users dot sourceforge.net
++ Assignee: unassigned at gcc dot gnu.org Reporter: msharov at users dot sourceforge.net Target Milestone: --- struct C { struct const_iterator { auto& operator++() { return *this; } }; }; Compiling with -Weffc++ gives warning: t.cc:3:24: warning: prefix ‘

[Bug tree-optimization/85697] At -Os nontrivial ctor does not use SSE to zero

2018-05-22 Thread msharov at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85697 --- Comment #2 from Mike Sharov --- I previously filed bug #49127 about the non-SSE version of the same xor/mov optimization. Perhaps both could be addressed in the same manner with a more general capability of zeroing with a register when doing

[Bug c++/85858] -Weffc++ should not require copy ctor for const pointers

2018-05-22 Thread msharov at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85858 --- Comment #12 from Mike Sharov --- (In reply to Jonathan Wakely from comment #10) > It's simply not how C++ works. Quite right. I already agreed with you here; we are arguing about whether it /should/ work this way :) > An object's lifetime

[Bug c++/85858] -Weffc++ should not require copy ctor for const pointers

2018-05-21 Thread msharov at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85858 --- Comment #8 from Mike Sharov --- (In reply to Jonathan Wakely from comment #7) > Your mental model of C++ is simply not how the language works. My mental model here is actually of const correctness, not C++ specifically. When I pass around a

[Bug c++/85858] -Weffc++ should not require copy ctor for const pointers

2018-05-21 Thread msharov at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85858 --- Comment #6 from Mike Sharov --- (In reply to Jonathan Wakely from comment #5) > Nope, see the C++ standard: > > [ Note: A pointer to a const type can be the operand of a > delete-expression; Ok, I guess; you have to follow the standard,

[Bug c++/85858] -Weffc++ should not require copy ctor for const pointers

2018-05-21 Thread msharov at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85858 --- Comment #4 from Mike Sharov --- (In reply to Jonathan Wakely from comment #3) > Nothing stops you deallocating a const pointer. According to http://en.cppreference.com/w/cpp/memory/new/operator_delete The delete operator takes a void* and

[Bug c++/85858] -Weffc++ should not require copy ctor for const pointers

2018-05-21 Thread msharov at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85858 --- Comment #2 from Mike Sharov --- (In reply to Jonathan Wakely from comment #1) > (In reply to Mike Sharov from comment #0) > > When the pointer is const, it can not point to owned memory > Why not? Because a const pointer can not be freed.

[Bug c++/85858] New: -Weffc++ should not require copy ctor for const pointers

2018-05-21 Thread msharov at users dot sourceforge.net
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: msharov at users dot sourceforge.net Target Milestone: --- -Weffc++ warns about missing operator= and copy ctor in a class containing a const pointer. The intent of the warning is to detect

[Bug c++/85856] New: -Weffc++ can't see implicitly deleted constructor

2018-05-21 Thread msharov at users dot sourceforge.net
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: msharov at users dot sourceforge.net Target Milestone: --- #include struct A { A (void) {} virtual ~A (void) {} A (const A&) = delete; void operator= (const A&) = delete; }; struct B : public A

[Bug c/80354] Poor support to silence -Wformat-truncation=1

2018-05-09 Thread msharov at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80354 --- Comment #9 from Mike Sharov --- (In reply to Martin Sebor from comment #8) > A simple way to avoid the warning while also avoiding bugs resulting from > unhandled truncation is to detect it and abort if it happens, e.g. First of all, you

[Bug c/80354] Poor support to silence -Wformat-truncation=1

2018-05-09 Thread msharov at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80354 Mike Sharov changed: What|Removed |Added CC||msharov at users dot sourceforge.n

[Bug target/85697] New: At -Os nontrivial ctor does not use SSE to zero

2018-05-08 Thread msharov at users dot sourceforge.net
: target Assignee: unassigned at gcc dot gnu.org Reporter: msharov at users dot sourceforge.net Target Milestone: --- struct alignas(16) A { A (void) :a(0),b(0),c(0),d(0) {} int a,b,c,d; }; __attribute__((noinline)) void UseA (A& a) { a.a=1; } int main (

[Bug c++/85695] New: if constexpr misevaluates typedefed type value

2018-05-08 Thread msharov at users dot sourceforge.net
++ Assignee: unassigned at gcc dot gnu.org Reporter: msharov at users dot sourceforge.net Target Milestone: --- template struct integral_constant { using value_type = T; static constexpr const value_type value = v; constexpr operator value_type (void) const

[Bug c++/85689] New: if constexpr compiles false branch

2018-05-07 Thread msharov at users dot sourceforge.net
++ Assignee: unassigned at gcc dot gnu.org Reporter: msharov at users dot sourceforge.net Target Milestone: --- int main (void) { if constexpr (false) static_assert (false, "this should not be compiled"); return 0; } g++ 8.1 fails compiling

[Bug target/59578] New: Overuse of v prefix for SSE instructions

2013-12-22 Thread msharov at users dot sourceforge.net
Assignee: unassigned at gcc dot gnu.org Reporter: msharov at users dot sourceforge.net typedef float v16sf __attribute__((vector_size(16))); v16sf f (v16sf x) { return (__builtin_ia32_shufps (x, x, 0xff)); } Compiled on a Haswell 4770 with -march=native -O emits: vshufps $255

[Bug target/57288] cfi_restore should precede cfi_def_cfa_offset

2013-11-10 Thread msharov at users dot sourceforge.net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57288 --- Comment #2 from Mike Sharov msharov at users dot sourceforge.net --- (In reply to Andrew Pinski from comment #1) Can you attach the preprocessed source which is used to create this assembly file? I'm afraid not. This call has been created

[Bug rtl-optimization/23684] Combine stores for non strict alignment targets

2013-05-18 Thread msharov at users dot sourceforge.net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23684 --- Comment #12 from msharov at users dot sourceforge.net --- I'd like to add that this is not some corner case; this is a very common issue. In my own projects, the compiler's inability to combine stores is the single largest reason for using

[Bug rtl-optimization/57302] New: Should merge zeroing multiple consecutive memory locations

2013-05-16 Thread msharov at users dot sourceforge.net
Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: msharov at users dot sourceforge.net struct A { short a,b; A (void); }; A::A (void) : a(0),b(0) {} void MoveA (const A* a, A* b) { *b = *a; } Generates: _ZN1AC2Ev

[Bug target/57288] New: cfi_restore should precede cfi_def_cfa_offset

2013-05-15 Thread msharov at users dot sourceforge.net
: target Assignee: unassigned at gcc dot gnu.org Reporter: msharov at users dot sourceforge.net Created attachment 30122 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=30122action=edit The emitted assembly exhibiting the ordering problem This is on x86_64, compiled with -Os

[Bug rtl-optimization/56598] New: Optimizer can't invert conditional when inlining a bool function

2013-03-11 Thread msharov at users dot sourceforge.net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56598 Bug #: 56598 Summary: Optimizer can't invert conditional when inlining a bool function Classification: Unclassified Product: gcc Version: 4.7.2 Status:

[Bug c++/56583] New: ICE with constexpr ctor and nested structs and unions

2013-03-09 Thread msharov at users dot sourceforge.net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56583 Bug #: 56583 Summary: ICE with constexpr ctor and nested structs and unions Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity:

[Bug libgcc/56277] New: libgcc.a and libgcc_eh.a should be compiled with function-level linking

2013-02-10 Thread msharov at users dot sourceforge.net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56277 Bug #: 56277 Summary: libgcc.a and libgcc_eh.a should be compiled with function-level linking Classification: Unclassified Product: gcc Version: 4.7.2

[Bug libgcc/56277] libgcc.a and libgcc_eh.a should be compiled with function-level linking

2013-02-10 Thread msharov at users dot sourceforge.net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56277 --- Comment #3 from msharov at users dot sourceforge.net 2013-02-11 00:33:03 UTC --- (In reply to comment #2) Do you think you have an example where adding -ffunction-sections can help for the compiled libgcc.a ? No, sorry. Checking

[Bug c++/53380] .ehframe could be smaller

2012-05-22 Thread msharov at users dot sourceforge.net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53380 --- Comment #3 from msharov at users dot sourceforge.net 2012-05-22 11:21:41 UTC --- Did -fno-asynchronous-unwind-tables do what you wanted it to do? In that disable the unwinding tables when not using exceptions? No, it did not. For example

[Bug c++/53380] .ehframe could be smaller

2012-05-22 Thread msharov at users dot sourceforge.net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53380 --- Comment #5 from msharov at users dot sourceforge.net 2012-05-22 18:53:32 UTC --- (In reply to comment #4) Adding default handling if there is no FDE is an ABI change, so can't be done on existing architectures (except those that have

[Bug c++/53380] New: .ehframe could be smaller

2012-05-16 Thread msharov at users dot sourceforge.net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53380 Bug #: 53380 Summary: .ehframe could be smaller Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: enhancement Priority: P3

[Bug rtl-optimization/52888] New: Unable to inline function pointer call with inexact signature match

2012-04-06 Thread msharov at users dot sourceforge.net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52888 Bug #: 52888 Summary: Unable to inline function pointer call with inexact signature match Classification: Unclassified Product: gcc Version: 4.7.0 Status:

[Bug rtl-optimization/49127] New: -Os generates constant mov instead of instruction xor and mov when zeroing

2011-05-23 Thread msharov at users dot sourceforge.net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49127 Summary: -Os generates constant mov instead of instruction xor and mov when zeroing Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: enhancement