[Bug c++/55576] New: Fails to compile a call to template member function

2012-12-03 Thread antoshkka at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55576 Bug #: 55576 Summary: Fails to compile a call to template member function Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal

[Bug c++/55576] Fails to compile a call to template member function

2012-12-03 Thread antoshkka at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55576 Antony Polukhin antoshkka at gmail dot com changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED

[Bug c++/55576] Fails to compile a call to template member function

2012-12-06 Thread antoshkka at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55576 --- Comment #7 from Antony Polukhin antoshkka at gmail dot com 2012-12-06 14:39:39 UTC --- (In reply to comment #6) The injected-class-name of a class template or class template specialization can be used either as a template-name

[Bug c++/56191] New: Destructor affects noexcept detection

2013-02-03 Thread antoshkka at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56191 Bug #: 56191 Summary: Destructor affects noexcept detection Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal

[Bug c++/56191] Destructor affects noexcept detection

2013-02-03 Thread antoshkka at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56191 Antony Polukhin antoshkka at gmail dot com changed: What|Removed |Added Resolution|FIXED

[Bug spam/5142] Bug#123687: Info received and FILED only

2013-02-03 Thread antoshkka at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5142 Antony Polukhin antoshkka at gmail dot com changed: What|Removed |Added CC

[Bug c++/56191] Destructor affects noexcept detection

2013-02-03 Thread antoshkka at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56191 --- Comment #4 from Antony Polukhin antoshkka at gmail dot com 2013-02-04 07:28:04 UTC --- Oh, thanks for clarification! Initially I was confused by the fact that std::is_nothrow_constructible checks for destructor, but I thought

[Bug c++/56191] Destructor affects noexcept detection

2013-02-03 Thread antoshkka at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56191 --- Comment #5 from Antony Polukhin antoshkka at gmail dot com 2013-02-04 07:29:16 UTC --- *** This bug has been marked as a duplicate of bug 51452 ***

[Bug libstdc++/51452] [DR 2116] has_nothrow_.*constructor bugs

2013-02-03 Thread antoshkka at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51452 --- Comment #16 from Antony Polukhin antoshkka at gmail dot com 2013-02-04 07:29:16 UTC --- *** Bug 56191 has been marked as a duplicate of this bug. ***

[Bug c++/55249] New: Multiple copy constructors for template class lead to link errors

2012-11-09 Thread antoshkka at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55249 Bug #: 55249 Summary: Multiple copy constructors for template class lead to link errors Classification: Unclassified Product: gcc Version: 4.6.3 Status:

[Bug c++/55249] Multiple copy constructors for template class lead to link errors

2012-11-09 Thread antoshkka at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55249 --- Comment #1 from Antony Polukhin antoshkka at gmail dot com 2012-11-09 10:24:49 UTC --- Created attachment 28648 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=28648 Preprocessed file that triggers the bug

[Bug c++/55249] Multiple copy constructors for template class lead to link errors

2012-11-09 Thread antoshkka at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55249 --- Comment #4 from Antony Polukhin antoshkka at gmail dot com 2012-11-09 12:28:11 UTC --- (In reply to comment #3) Yes, thanks. `output.txt` will be the same. Also, reproduced this bug on GCC 4.7.2: [cc@ontos-soa-01 ~]$ gcc -v

[Bug libstdc++/59439] std::locale uses atomic instructions on construction

2014-04-20 Thread antoshkka at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59439 Antony Polukhin antoshkka at gmail dot com changed: What|Removed |Added CC||antoshkka

[Bug ipa/64218] New: ICE during compilation with -fno-rtti -O3

2014-12-08 Thread antoshkka at gmail dot com
Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Following error occurred during compilation of one of the Boost's tests: ../libs/variant/test/recursive_variant_test.cpp:315:1: internal compiler error: Segmentation fault } ^ 0xc9658f crash_signal

[Bug ipa/64218] [5 Regression] ICE: Segmentation fault (symtab_node::get_alias_target()) running Boost testsuite

2014-12-15 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64218 --- Comment #8 from Antony Polukhin antoshkka at gmail dot com --- A few more observations: * Same Boost test compiles and works well on -mcpu=power8 with -fno-rtti * Test fails to compile on -mcpu=power8 *WITH RTTI on*: 0x109ccb0b crash_signal

[Bug libstdc++/64913] New: basic_string fails to use custom allocator

2015-02-03 Thread antoshkka at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Consider the following example: templateclass CharT struct my_allocator : std::allocatorCharT {}; typedef std::basic_string char , std::char_traitschar , my_allocatorchar my_string

[Bug libstdc++/66699] New: Incorrect order of destruction for std::tuple elements

2015-06-29 Thread antoshkka at gmail dot com
Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- According to C++ Standard: An instantiation of tuple with two arguments is similar to an instantiation of pair with the same two arguments. The following

[Bug libstdc++/66699] Incorrect order of destruction for std::tuple elements

2015-06-29 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66699 --- Comment #3 from Antony Polukhin antoshkka at gmail dot com --- (In reply to Martin Sebor from comment #2) Since the layout of std::pair members is fully specified, so is the order of their initialization and destruction. The output

[Bug libstdc++/58265] [lwg/2063] std::string move assignment should be noexcept

2015-07-17 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58265 Antony Polukhin antoshkka at gmail dot com changed: What|Removed |Added CC||antoshkka

[Bug libstdc++/71579] New: type_traits miss checks for type completeness in some traits

2016-06-18 Thread antoshkka at gmail dot com
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Completeness is the requirement of C++ Standard. Without completeness check hard detectable errors are possible: #include struct foo

[Bug libstdc++/71579] type_traits miss checks for type completeness in some traits

2016-06-29 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71579 --- Comment #2 from Antony Polukhin --- You are right. But those wrong usages are simple to catch and a static_assert with a readable message would be a huge help for users: template struct assert_complete { typedef char yes_type;

[Bug ipa/80317] New: Missed optimization for common standard library case

2017-04-04 Thread antoshkka at gmail dot com
Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- It's a common case in standard library and in user code to move objects to new location and then destroy object at the old location. For example GCC's std::vector

[Bug tree-optimization/81461] New: Optimization for removing same variable comparisons in loop: while(it != end1 && it != end2)

2017-07-17 Thread antoshkka at gmail dot com
ONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Simple iteration by std::deque elements produces suboptimal code. For example

[Bug tree-optimization/81461] Optimization for removing same variable comparisons in loop: while(it != end1 && it != end2)

2017-07-17 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81461 --- Comment #2 from Antony Polukhin --- (In reply to Richard Biener from comment #1) > jump threading Thanks, now I know hot the transformation of for (;it != end && it != *chunks + 128; ++it) { sum += *it; } into

[Bug c++/80542] New: Warn about accidental copying of data in range based for

2017-04-27 Thread antoshkka at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Here's a small example with accidental copying that could be often seen in code: ``` #include #include #include int main() { std::map

[Bug c++/81767] New: Unused variable warning with structured binding

2017-08-08 Thread antoshkka at gmail dot com
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- The following code produces "warning: unused variable 'ignore' [-Wunused-variable]": int main() { int m[2][2] = {{1,2}, {3, 4}}; int sum = 0;

[Bug c++/81767] Unused variable warning with structured binding

2017-08-09 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81767 Antony Polukhin changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/81911] Constant expression from permitted result of a constant expression is not constexpr

2017-08-23 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81911 Antony Polukhin changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/81888] New: Structured bindings stopped working

2017-08-18 Thread antoshkka at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- The following code worked well on GCC-7.1, but fails on GCC-7.2 with -std=c++17: struct do_not_define_std_tuple_size_for_me { bool test1 = true; }; template bool

[Bug c++/81129] New: GCC successfully compiles expression into nothing

2017-06-19 Thread antoshkka at gmail dot com
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- The following code successfully compiles by GCC with -std=c++11 and -std=c++03: void print(bool) { throw 1; } int main() { void(*)(bool){}(false); } The bad

[Bug libstdc++/71579] type_traits miss checks for type completeness in some traits

2017-05-24 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71579 --- Comment #6 from Antony Polukhin --- C++ LWG related issue: http://cplusplus.github.io/LWG/lwg-active.html#2797

[Bug target/82418] Division on a constant is suboptimal because of not using imul instruction

2017-10-04 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82418 --- Comment #2 from Antony Polukhin --- I've checked the instructions cost according to the "4. Instruction tables" by By Agner Fog. Technical University of Denmark. For skylake: ; recip throughpLatency Ports

[Bug target/82430] New: [4.9 Regression] Suboptimal code generated because of unnecessary "pxor xmm0, xmm0"

2017-10-04 Thread antoshkka at gmail dot com
NCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following code snippets unsigned my_mul(unsigned a) { return a * 1.5; } unsigned my_di

[Bug middle-end/82504] Optimize away exception allocation and throws handled by catch(...){}

2017-10-10 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82504 --- Comment #2 from Antony Polukhin --- +1. Some realistic code examples were the optimization could be very useful if triggered after inlining: // Destructors bar::~bar() { try { cleanup_some_dangerous_resources(); } catch(...)

[Bug middle-end/82504] New: Optimize away exception allocation and throws handled by catch(...){}

2017-10-10 Thread antoshkka at gmail dot com
Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following function void foo() { try { throw 1; } catch(...) {} } produces the following assembly at -O2: foo

[Bug middle-end/82504] Optimize away exception allocation and throws handled by catch(...){}

2017-10-10 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82504 --- Comment #4 from Antony Polukhin --- This ticket is a subset of PR53294. PR53294 about any catch expression optimizations, which could be harder than optimizing away catch(...) {} and catch(...) { return X; }

[Bug middle-end/82504] Optimize away exception allocation and throws handled by catch(...){}

2017-10-10 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82504 Antony Polukhin changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/53294] Optimize out some exception code

2017-10-10 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53294 --- Comment #2 from Antony Polukhin --- *** Bug 82504 has been marked as a duplicate of this bug. ***

[Bug middle-end/82438] New: Memory access not optimized for loops with known bounds

2017-10-05 Thread antoshkka at gmail dot com
Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Reading and writing small data in loops with -O2 generates "movzx ecx, BYTE PTR [rdi+rdx]" and "mov BYTE PTR [rax], 15"

[Bug tree-optimization/82450] New: Consider optimizing multidimensional arrays access without -ftree-vectorize

2017-10-06 Thread antoshkka at gmail dot com
: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Iterating over multidimensional array uses a counter for each dimension. For code using array_t = unsigned[10

[Bug target/82447] New: Consider removing cmp instruction while iterating on an array of known bound

2017-10-06 Thread antoshkka at gmail dot com
: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following code unsigned loop_read(unsigned char* a) { const unsigned size = 128; unsigned sum = 0

[Bug other/82543] libbacktrace does not retrieve function names on 64 bit windows (using mingw)

2017-10-13 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82543 --- Comment #1 from Antony Polukhin --- Checked on the trunk version of libbacktrace (r253491) Issue still exists

[Bug other/82543] New: libbacktrace does not retrieve function names on 64 bit windows (using mingw)

2017-10-13 Thread antoshkka at gmail dot com
: normal Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- A bunch of people noticed that libbacktrace built with mingw does not retrieve function names or even fails: https

[Bug target/82516] New: Optimize jmp chain

2017-10-11 Thread antoshkka at gmail dot com
: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following code unsigned bar(); unsigned foo1(int i) { if (i < 0) { return bar(); } return i; } at -O2 produces the assembly: foo1(int): testedi, edi

[Bug c++/82361] New: Useless "mov eax, eax" in generated code

2017-09-29 Thread antoshkka at gmail dot com
mponent: c++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following function struct ret_t { unsigned quot, rem; }; ret_t my_div(unsigned a, unsigned b) { return {a / b, a % b}; } Produces suboptimal assembly: my_div(un

[Bug c++/23383] builtin array operator new is not marked with malloc attribute

2017-10-02 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=23383 --- Comment #26 from Antony Polukhin --- > That said, it would be fine to add support for this > under a non-standards-mode option of some sort of course. C++14 allows to merge and remove global allocations [expr.new]: "An implementation is

[Bug target/82404] New: Unnecessary instructions in switch table

2017-10-02 Thread antoshkka at gmail dot com
Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following code enum class eShape { eSquare, eCircle, eShpere, eTetraeder }; double test_switch_native(eShape shape, double r) { switch(shape) { case eShape::eSquare

[Bug c++/82405] New: Function not inlined for switch and suboptimal assembly is generated

2017-10-02 Thread antoshkka at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following code enum class eShape { eSquare, eCircle, eShpere, eTetraeder }; static inline double eval_square(double r) { return 4

[Bug c++/82394] Pointer imposes an optimization barrier

2017-10-02 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82394 --- Comment #2 from Antony Polukhin --- Used -O2 flag

[Bug c++/82394] New: Pointer imposes an optimization barrier

2017-10-02 Thread antoshkka at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following code unsigned my_sorted_array() { unsigned data[6] = {1, 0, 7, 7, 7, 0}; // Hand written std::min_element unsigned m = data[0]; for (unsigned* it = data

[Bug c++/82405] Function not inlined for switch and suboptimal assembly is generated

2017-10-03 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82405 --- Comment #6 from Antony Polukhin --- > And I don't think you can reassociate here validly unless -ffast-math. But you can. In the isolated test case, instead of getting r*r at first, just move the constant into the xmm1 first and after that

[Bug c++/82405] Function not inlined for switch and suboptimal assembly is generated

2017-10-03 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82405 --- Comment #8 from Antony Polukhin --- Yes, in the isolated test case constants are first: static inline double eval_square2(double r) { return 4 * r * r; } static inline double eval_circle2(double r) { return 3.1415 * r * r; } double

[Bug target/82418] New: Division on a constant is suboptimal because of not using imul instruction

2017-10-03 Thread antoshkka at gmail dot com
: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following code unsigned my_div(unsigned a, unsigned b) { return a / 100; } Produces assembly: my_div(unsigned int

[Bug c++/81911] New: Constant expression from permitted result of a constant expression is not constexpr

2017-08-21 Thread antoshkka at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- The following code fails to compile: int main() { static const char someVar[] = "str"; constex

[Bug c++/82019] New: [concepts] ICE if concept is not satisfied

2017-08-29 Thread antoshkka at gmail dot com
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following code causes ICE: template concept bool VectorOperations = requires(T& v, const Data& data) { { v += data } -> T&; }; templat

[Bug other/82543] libbacktrace does not retrieve function names on 64 bit windows (using mingw)

2017-10-24 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82543 --- Comment #2 from Antony Polukhin --- The error is within `fileline_initialize` function in `libbacktrace/fileline.c` If the `backtrace_state*` constructed using the `backtrace_create_state` call with first parameter set to 0, then filename

[Bug target/82935] New: Unnecessary "sub rsp, 8", "call" and "add rsp, 8" instructions

2017-11-10 Thread antoshkka at gmail dot com
MED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following code typedef struct array_ { int data[10202023]; } array; void assign(array* a1, array* a2)

[Bug target/82935] Unnecessary "sub rsp, 8", "call" and "add rsp, 8" instructions

2017-11-10 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82935 --- Comment #2 from Antony Polukhin --- > Why do you think these instructions are not needed? Because Clang does not generate them.

[Bug c++/83231] New: ICE on constexpr evaluation

2017-11-30 Thread antoshkka at gmail dot com
: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following valid example struct GUID { unsigned long Data1; unsigned char Data2[ 4 ]; }; constexpr bool is_equal(GUID lhs, GUID rhs) { return lhs.Data1 == rhs.Data1

[Bug target/83031] New: Tail call optimization not used in cases when first part of the result is returned from function

2017-11-17 Thread antoshkka at gmail dot com
Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following code: struct ts {int a, b; }; ts foo(); int testing1() { return foo().a; } Produces

[Bug middle-end/83032] New: Copy elision for returning subobject

2017-11-17 Thread antoshkka at gmail dot com
Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following code struct trace { trace(trace const &) noexcept; ~trace(); }; struct ts { trace a, b; }; ts foo(); trace testing() { return foo().a; } Comp

[Bug middle-end/83032] Copy elision for returning subobject

2017-11-18 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83032 --- Comment #2 from Antony Polukhin --- > I don't think that's one of the cases where the C++ standard allows elision Yes, you're right (currently I try to convince C++ standard pepole that allowing it could be benefical). But C does not

[Bug middle-end/82885] New: memcpy does not propagate aliasing knowledge

2017-11-07 Thread antoshkka at gmail dot com
: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- The following code: void foo3(char* ch1, const char* ch2) { __builtin_memcpy(ch1, ch2, 1024*1024); ch1[0] = ch2[2]; ch1[1] = ch2[2]; } Produces assembly

[Bug middle-end/82918] New: No aliasing is possible on non equal pointers

2017-11-09 Thread antoshkka at gmail dot com
Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following code struct array { int data[3]; }; void foo2(array& value, const array& value2) { if ( ==

[Bug middle-end/82898] New: Aliasing knowledge is not used to replace memmove with memcpy

2017-11-08 Thread antoshkka at gmail dot com
Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- This has been resolved once in Bug 21602 but now the issue appears again: void foo(int* i, const float* f) { __builtin_memmove(i

[Bug middle-end/82899] *this in constructors could not alias with reference input parameters of the same type

2017-11-08 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82899 --- Comment #3 from Antony Polukhin --- BTW, Clang warns on code like Y y(y) warning: variable 'y' is uninitialized when used within its own initialization [-Wuninitialized] Y y(y); ~ ^ GCC may add same warning

[Bug c++/82900] New: Warn on initialization with self

2017-11-08 Thread antoshkka at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following code struct Y { Y(Y&){} }; int main() { Y y(y); } Produces a useful warning on clang: warning: variable 'y' is uninitialized when used within its own initializa

[Bug middle-end/82898] Aliasing knowledge is not used to replace memmove with memcpy

2017-11-08 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82898 --- Comment #3 from Antony Polukhin --- > At least in the gcc model, the type of a pointer is meaningless > as long as you do not dereference it using that type<...> OK, does dereferencing the pointers change anything? void foo(int* i, const

[Bug middle-end/82899] New: *this in constructors could not alias with reference input parameters of the same type

2017-11-08 Thread antoshkka at gmail dot com
Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following code struct test { char data[2] = {1, 2}; test(const test& v); ~test(){} //

[Bug middle-end/82899] *this in constructors could not alias with reference input parameters of the same type

2017-11-08 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82899 --- Comment #2 from Antony Polukhin --- Looks like [class.ctor] paragraph 14 covers this case: "During the construction of an object, if the value of the object or any of its subobjects is accessed through a glvalue that is not obtained,

[Bug c++/82899] *this in constructors could not alias with reference input parameters of the same type

2017-11-08 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82899 --- Comment #6 from Antony Polukhin --- Done: Bug 82900

[Bug middle-end/82404] Unnecessary instructions in switch table

2017-11-07 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82404 --- Comment #10 from Antony Polukhin --- Do we need a autotest on that to make sure that cmp won't appear again?

[Bug target/82883] New: eax register unnecessary consumed

2017-11-07 Thread antoshkka at gmail dot com
Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following example: void foo(char* ch) { __builtin_memcpy(ch, "Hello word", 6); } Produces the assembly foo(char*): mov eax, 8303 <=== This is

[Bug c++/85747] suboptimal code without constexpr

2018-05-14 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85747 --- Comment #7 from Antony Polukhin --- (In reply to Jakub Jelinek from comment #6) > IMHO just use constexpr if you care about compile time evaluation > guarantees, that is what it has been added for. Fair point. Overcomplicated logic on the

[Bug c++/82899] *this in constructors could not alias with reference input parameters of the same type

2018-05-10 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82899 --- Comment #9 from Antony Polukhin --- There's an identical issue for clang: https://bugs.llvm.org/show_bug.cgi?id=37329 During review of that issue Richard Smith noted that the solution could be made more generic by adding `__restrict` for

[Bug c++/82899] *this in constructors could not alias with reference input parameters of the same type

2018-05-10 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82899 --- Comment #11 from Antony Polukhin --- Seems perfect https://godbolt.org/g/GX3GQd The mov is not generated for any constructor and the following code: extern struct A a; struct A { int m, n; A(const A ); }; A::A(const A ) : m(v.m),

[Bug c++/82899] *this in constructors could not alias with reference input parameters of the same type

2018-05-10 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82899 --- Comment #12 from Antony Polukhin --- (In reply to Marc Glisse from comment #10) > This seems fixed in 8.1 (at least we don't generate the extra mov anymore), > can you check? Actually it still does not work for subobjects. For example

[Bug c++/85747] New: suboptimal code without constexpr

2018-05-11 Thread antoshkka at gmail dot com
: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Consider the following code snippet: // Bubble-like sort. Anything complex enough will work template constexpr void sort(It first, It last

[Bug c++/85747] suboptimal code without constexpr

2018-05-11 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85747 --- Comment #3 from Antony Polukhin --- (In reply to Richard Biener from comment #1) > What's the reason for writing the code as you pasted it? I've tried to provide a simplified case. In real world `generate()` function will have some

[Bug c++/85747] suboptimal code without constexpr

2018-05-11 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85747 --- Comment #4 from Antony Polukhin --- (In reply to Marc Glisse from comment #2) > (In reply to Antony Polukhin from comment #0) > > Could the compiler detect that `a[7]` holds values known at compile time and > > force the constexpr on `sort(a

[Bug c++/86373] New: Destructor shall not be instantiated in C++17 mode for prvalue

2018-07-02 Thread antoshkka at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following program fails to compile in -std=c++17 mode struct some { some() = default; ~some() = delete; }; some foo() { return

[Bug c++/86375] New: Lambda call in template parameter causes compile time error

2018-07-02 Thread antoshkka at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following example fail to compile: template struct stuff {}; stuff< [](){ return 42; }() > a; // Calling a constexpr lambda Error m

[Bug c++/82899] *this in constructors could not alias with reference input parameters of the same type

2018-05-03 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82899 --- Comment #8 from Antony Polukhin --- (In reply to Richard Biener from comment #4) > (In reply to Antony Polukhin from comment #2) > > Looks like [class.ctor] paragraph 14 covers this case: > > > > "During the construction of an object, if

[Bug libstdc++/83754] New: Segmentation fault in regex_search

2018-01-09 Thread antoshkka at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- The following code #include #include int main() { std::regex pattern("\\w+\\."); std::string s(100, 'a'); return std::regex_search(s, pattern);

[Bug middle-end/84147] New: RTTI for base class in anonymous namespace could be avoided

2018-01-31 Thread antoshkka at gmail dot com
Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Consider the example namespace { struct base { virtual int foo() noexcept {return 1;} }; } struct derived1 final : base

[Bug c++/84099] New: Dynamic initialization is performed in case when constant initialization is permitted

2018-01-29 Thread antoshkka at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- The following code struct foo { const char* data_; unsigned size_; foo(const char* data, unsigned

[Bug c++/84103] New: Dynamic initialization is performed for non-local variables in case when constant initialization is permitted

2018-01-29 Thread antoshkka at gmail dot com
Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following code struct foo { const char* data_; unsigned size_

[Bug c++/84306] New: Wrong overload selected with -std=c++17, explicit and {}

2018-02-09 Thread antoshkka at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following code uses function (1), however function (2) must be used. struct foo { foo() = default; foo(foo const&); /

[Bug libstdc++/84323] call_once uses TLS even when once_flag is set

2018-02-12 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84323 --- Comment #1 from Antony Polukhin --- Fixing this will also resolve Bug 55394, because there'll be no need in linking with pthread.

[Bug libstdc++/84323] New: call_once uses TLS even when once_flag is set

2018-02-11 Thread antoshkka at gmail dot com
: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Disassembly of the following code: #include std::once_flag once; int* foo() { static int* p{}; std::call_once(once,[](){ p = 0; }); return p

[Bug tree-optimization/86732] Potential nullptr dereference does not propagate knowledge about the pointer

2018-08-03 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86732 Antony Polukhin changed: What|Removed |Added Resolution|INVALID |FIXED --- Comment #9 from Antony

[Bug c++/86697] New: decltype for lambda capture gives wrong type

2018-07-27 Thread antoshkka at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- According to the wg21.link/P0588R1 and Richard Smith's words from https://bugs.llvm.org//show_bug.cgi?id=38325#c1 the following code should compile: #include #include

[Bug tree-optimization/86732] New: Potential nullptr dereference does not propagate knowledge about the pointer

2018-07-30 Thread antoshkka at gmail dot com
: missed-optimization Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Following example static const int* get_if(const int* v) { if (v

[Bug tree-optimization/86732] Potential nullptr dereference does not propagate knowledge about the pointer

2018-07-30 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86732 --- Comment #1 from Antony Polukhin --- Probably a more fair example< without taking an address of a reference: static const int* get_if(const int* v) { if (v && *v == 0) return v; return nullptr; } int example(const int* a) {

[Bug middle-end/86912] New: Function pointer imposes an optimization barrier

2018-08-10 Thread antoshkka at gmail dot com
Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Consider the following minimized example of std::variant visitation: struct A {}; struct B : A {}; struct C : A {}; struct D

[Bug middle-end/86909] Missing common subexpression elimination for types other than int

2018-08-10 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86909 --- Comment #1 from Antony Polukhin --- Another std::variant related example where GCC fails to eliminate subexpressions and generates 6 times bigger assembly: using size_t = unsigned long long; struct A {} a; static const size_t variant_npos

[Bug middle-end/86909] New: Missing common subexpression elimination for types other than int

2018-08-10 Thread antoshkka at gmail dot com
-optimization Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Consider the following minimized example of the std::variant visitation: using size_t

[Bug tree-optimization/57492] Optimize 2.0**i to ldexp(1.0,i)

2018-08-27 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57492 --- Comment #3 from Antony Polukhin --- More examples: double test_uns(unsigned u) { return __builtin_pow(2, u); } double test_int(int i) { return __builtin_pow(2, i); } Above two functions clang optimizes to exp2 and ldexp calls:

[Bug libstdc++/78113] std::variant and std::visit's current implementations do not get optimized out (compared to "recursive visitation")

2018-08-27 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78113 --- Comment #1 from Antony Polukhin --- Note that this bug is related to Bug 86912. Fixing Bug 86912 should automatically resolve this issue (but not vice versa).

[Bug libstdc++/78113] std::variant and std::visit's current implementations do not get optimized out (compared to "recursive visitation")

2018-08-27 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78113 --- Comment #2 from Antony Polukhin --- Here's another example: #include struct A {}; struct B : A {}; struct C : A {}; struct D : A {}; struct E : A {}; struct X : A {}; struct visitor { template A& operator()(T& v) const noexcept

  1   2   3   >