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
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55576
Antony Polukhin antoshkka at gmail dot com changed:
What|Removed |Added
Status|RESOLVED|UNCONFIRMED
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
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
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56191
Antony Polukhin antoshkka at gmail dot com changed:
What|Removed |Added
Resolution|FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5142
Antony Polukhin antoshkka at gmail dot com changed:
What|Removed |Added
CC
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
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 ***
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. ***
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:
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
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
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59439
Antony Polukhin antoshkka at gmail dot com changed:
What|Removed |Added
CC||antoshkka
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
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
++
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
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
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58265
Antony Polukhin antoshkka at gmail dot com changed:
What|Removed |Added
CC||antoshkka
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
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;
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
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
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
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
: 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;
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81767
Antony Polukhin changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81911
Antony Polukhin changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
++
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
: 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
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
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
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
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(...)
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
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; }
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82504
Antony Polukhin changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
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. ***
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"
: 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
: 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
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
: 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
: 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
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
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
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
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82394
--- Comment #2 from Antony Polukhin ---
Used -O2 flag
++
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
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
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
: 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
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
: 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
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
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)
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.
: 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
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
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
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
: 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
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 ( ==
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
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
++
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
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
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(){} //
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,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82899
--- Comment #6 from Antony Polukhin ---
Done: Bug 82900
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?
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
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
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
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),
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
: 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
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
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
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
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
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
++
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);
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
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
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_
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&); /
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.
: 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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86732
Antony Polukhin changed:
What|Removed |Added
Resolution|INVALID |FIXED
--- Comment #9 from Antony
++
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
: 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
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) {
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
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
-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
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:
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).
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 - 100 of 262 matches
Mail list logo