++
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
Consider this code:
template
struct X
{};
template
X f();
template
X g();
int main()
{
g();
}
On GCC 12.2 it gives this error message:
:13:12: error: no matching
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108676
--- Comment #1 from Ivan Sorokin ---
I added a broken link to godbolt, here is a valid one:
https://godbolt.org/z/EE5eezW1r
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108676
Ivan Sorokin changed:
What|Removed |Added
Resolution|--- |DUPLICATE
Status|NEW
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66968
Ivan Sorokin changed:
What|Removed |Added
CC||vanyacpp at gmail dot com
--- Comment #9
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66968
--- Comment #10 from Ivan Sorokin ---
One more case (from 108676):
template
struct X
{};
template
X f();
template
X g();
int main()
{
g();
}
Here 'X' is printed in the error message instead of 'X'.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108219
--- Comment #5 from Ivan Sorokin ---
(In reply to Patrick Palka from comment #4)
> Fixed for GCC 13 so far
Thank you very much!
: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
Consider this code:
namespace a
{
namespace c
{}
struct a
{};
namespace b = a::c; // (1)
using
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105141
Ivan Sorokin changed:
What|Removed |Added
CC||vanyacpp at gmail dot com
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105762
Ivan Sorokin changed:
What|Removed |Added
CC||vanyacpp at gmail dot com
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98709
Ivan Sorokin changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19987
Bug 19987 depends on bug 98709, which changed state.
Bug 98709 Summary: gcc optimizes bitwise operations, but doesn't optimize
logical ones
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98709
What|Removed |Added
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101706
Ivan Sorokin changed:
What|Removed |Added
CC||vanyacpp at gmail dot com
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103382
Ivan Sorokin changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
ormal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
On this code:
struct mytype
{
int a;
mutable int b;
};
extern mytype const p = {1, 2};
int foo()
{
return p.a
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107161
--- Comment #2 from Ivan Sorokin ---
> Do constexpr/consteval work in such circumstances?
Yes, constexpr works for variables like "p.a":
extern constexpr mytype p = {1, 2};
int foo()
{
constexpr int t = p.a + 10;
return t;
}
foo():
: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
At the moment condition_variable::wait() is marked noexcept. It means that if
pthread_cond_wait() acts as cancellation
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103382
--- Comment #1 from Ivan Sorokin ---
Please note there was a related issue PR67726. I hope it is possible to meet
the requirements mentioned in the issue as well as enabling cancellation.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103382
--- Comment #3 from Ivan Sorokin ---
> Huh, I thought it was noexcept. Then yes, we should remove it.
Thank you very much! I'm looking forward for a fix.
> There are still lots of other places where the stadnard does require
> 'noexcept' and
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103559
Ivan Sorokin changed:
What|Removed |Added
CC||vanyacpp at gmail dot com
--- Comment
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
On this code GCC says:
typedef int foo = 42;
error: typedef 'foo' is initialized (use 'decltype' instead)
I believe this error message is
++
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
struct mytype
{
int memfun [[gnu::pure]] ();
};
void test()
{
mytype x;
x.memfun();// -Wunused-value
mytype().memfun(); // no -Wunused-value
}
https://godbolt.org/z
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98774
--- Comment #4 from Ivan Sorokin ---
I retested the sample on GCC 11.2.
https://godbolt.org/z/xrarP3zbY
Compared to Clang 12.0.1 GCC still generates 6 more instructions in total and
does 6 mulpd against Clang's 4 mulpd.
: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
void escape(unsigned long long& a);
void foobar()
{
unsigned long long local;
escape(local);
}
For the function "foobar" GCC allocates excessive stack space:
foobar(
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61355
--- Comment #6 from Ivan Sorokin ---
(In reply to Patrick Palka from comment #5)
> Fixed for GCC 12.
Thanks!
++
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
Consider this code:
struct mytype
{
mytype();
mytype(mytype const&);
mytype(mytype&&);
};
void test()
{
mytype e;
throw e;
}
Currently for function test() GCC g
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
Normally GCC combines a/b and a%b into one operation when they are computed in
the same basic-block. The example below has two functions. For one GCC is
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102881
Ivan Sorokin changed:
What|Removed |Added
CC||vanyacpp at gmail dot com
--- Comment
ormal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
This functions causes undefined behavior and should not be evaluated at
compile-time.
The problem is the second argume
ormal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
I believe this function contains undefined behavior and should not be allowed
to evaluate at compile-time.
The call to `std::destroy
++
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
This code compiles OK on clang, MSVC and GCC prior to 12:
template
concept test = requires
{
new T[1]{{ 42 }};
};
struct foobar
{
foobar(int);
};
int main
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104503
Ivan Sorokin changed:
What|Removed |Added
CC||vanyacpp at gmail dot com
--- Comment
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
This sample is reduced from a real usage of shared_ptr.
#include
#include
struct sp_counted_base
{
sp_counted_base
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
Currently storing a nullptr_t to memory causes 0 to be written to that memory.
As there is no way to read this value back
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105864
--- Comment #5 from Ivan Sorokin ---
I would suggest (In reply to Andrew Pinski from comment #4)
> nullptr_t t, t1 = nullptr;
> __builtin_memcpy(&a[0], &t, sizeof(t));
> So I suspect this should be marked as invalid.
The questions is how G
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109986
--- Comment #5 from Ivan Sorokin ---
(In reply to CVS Commits from comment #4)
> commit r14-2751-g2a3556376c69a1fb588dcf25225950575e42784f
> Author: Drew Ross
> Co-authored-by: Jakub Jelinek
Thank you!
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98710
--- Comment #7 from Ivan Sorokin ---
(In reply to Andrew Pinski from comment #6)
> Fixed.
Thank you!
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98710
--- Comment #8 from Ivan Sorokin ---
> How often these show up, I have no idea.
Perhaps I should have written this in the original message.
The original expression "(x | c) & ~(y | c)" is obviously a reduced version of
what happens in real
ity: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
On this function clang generates shorter code:
unsigned foo(unsigned x, unsigned y, unsigned c)
{
return x & ~c | (y | c);
}
Clang notic
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111718
Ivan Sorokin changed:
What|Removed |Added
CC||vanyacpp at gmail dot com
--- Comment
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
On this function
short test(short* a)
{
*a = 1;
return *a;
}
latest gcc -O2 generates:
test(short*):
mov eax, 1
mov WORD PTR [rdi], ax
: analyzer
Assignee: dmalcolm at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
While cleaning up one not particularly well written program I noticed this code
fragment:
FILE* file = fopen(...);
if (!file)
{
fclose(file);
return false;
}
Passing
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109570
--- Comment #1 from Ivan Sorokin ---
Generalizing. Perhaps similarly free(NULL) can be detected?
void* obj = malloc(...);
if (!obj)
{
free(obj);
return false;
}
Unliky fclose(NULL), free(NULL) is completely well defined operation, but
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99087
Ivan Sorokin changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
int x = auto(42); // OK
int y(auto(42)); // error
On the second line GCC -std=c++23 gives an error:
error: non-function 'y' declared as implicit template
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112480
Ivan Sorokin changed:
What|Removed |Added
CC||vanyacpp at gmail dot com
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112480
--- Comment #7 from Ivan Sorokin ---
(In reply to Jonathan Wakely from comment #6)
> + // The following seems redundant but improves codegen, see PR 112480.
> + if constexpr (is_trivially_destructible_v<_Tp>)
> + this->_M_en
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
On this code
static bool is_even(unsigned a)
{
return a % 2 == 0;
}
bool same_evenness(uns
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71990
Ivan Sorokin changed:
What|Removed |Added
CC||vanyacpp at gmail dot com
--- Comment #5
middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
int foo(int a, int b)
{
return (~a | b) ^ a;
}
This can be optimized to `return ~(a | b);`. This transformation is done by
LLVM, but not by GCC.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109986
--- Comment #1 from Ivan Sorokin ---
(In reply to Ivan Sorokin from comment #0)
> int foo(int a, int b)
> {
> return (~a | b) ^ a;
> }
>
> This can be optimized to `return ~(a | b);`. This transformation is done by
> LLVM, but not by GCC.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109986
--- Comment #3 from Ivan Sorokin ---
I tried to investigate why GCC is able to simplify `(a | b) ^ a` and `(a | ~b)
^ a` from comment 2, but not similarly looking `(~a | b) ^ a` from comment 0.
`(a | b) ^ a` matches the following pattern from m
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
GCC gives -Wuninitialized on this code:
#include
uint16_t test()
{
uint32_t foo32[4] = {0, 0, 0, 0};
uint16_t* foo16
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110561
Ivan Sorokin changed:
What|Removed |Added
CC||vanyacpp at gmail dot com
--- Comment
101 - 153 of 153 matches
Mail list logo