Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
int __attribute__ ((noinline))
foo (int arg)
{
return 2 * arg;
}
int
bar (int arg)
{
return foo (5);
}
results in:
foo.constprop.0:
mov eax, 10
ret
foo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7061
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104187
--- Comment #8 from Dávid Bolvanský ---
So this works in Clang now
int foo(int x, int y) { // any compiler will happily inline this function
return x / y;
}
int test(int x, int y) {
int r = 0;
[[clang::noinline]] r += foo(x, y); //
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104187
--- Comment #5 from Dávid Bolvanský ---
So you prefer eg.
g = a[i] - [[gnu::always_inline]] foo(x, y) + 2 * bar();
over
g = a[i] - __builtin_always_inline(foo(x, y)) + 2 * bar();
?
What is your proposed syntax?
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
It could be useful to have more control over inlining. Use cases:
int foo();
void bar();
int g;
void test()
{
g = __builtin_always_inline(foo()); // force
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93150
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
#define C 3
struct node {
struct node *next;
int payload;
};
static int count_nodes(const node* p) {
int size = 0;
while (p) {
p = p
: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
void test1(int *p, int *t, int N) {
for (int i = 0; i != N; i++) *t += p[i];
}
void test2(int *p, int
: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
char foo (char* p)
{
char sum = 0;
for (int i = 0; i != 4; i++)
sum += p[i];
return sum;
}
-O3 -march=x86-64
GCC trunk:
foo
: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
#include
struct pam {
void *p1;
void *p2;
#ifdef LONG
unsigned long size;
#else
unsigned int pad;
unsigned int size;
#endif
};
extern int use(struct pam *param);
unsigned int
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99971
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98348
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98713
--- Comment #5 from Dávid Bolvanský ---
User knows the data better, so he/she may prefer abs with branch.
Also PGO may say that branch for abs is better based on profile data.
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
int branch_abs(int v) {
return __builtin_expect(v > 0, 1) ? v : -v;
}
GCC -O2 now:
branch_abs:
mov eax, edi
neg eax
cm
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98663
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98658
--- Comment #3 from Dávid Bolvanský ---
Yes, runtime check.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98658
--- Comment #1 from Dávid Bolvanský ---
ICC produces memcpy:
https://godbolt.org/z/oKxxTM
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
void copy(int *__restrict__ d, int * s, __SIZE_TYPE__ sz) {
__SIZE_TYPE__ i;
for (i = 0; i < sz; i++) {
*d++ = *s++;
}
}
gcc emits call to memcpy.
v
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31799
--- Comment #6 from Dávid Bolvanský ---
^ Posted by mistake. Sorry.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96433
--- Comment #1 from Dávid Bolvanský ---
Codegen:
https://godbolt.org/z/7EvYj9
foo:
movabs rdx, -6148914691236517205
mov rax, rdi
mul rdx
mov rax, rdx
and rdx, -2
shr rax
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31799
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
: c
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
const __SIZE_TYPE__ N = 3;
int foo(__SIZE_TYPE__ len) {
__SIZE_TYPE__ newlen = (len / N) * N;
return newlen <= len;
}
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96337
--- Comment #14 from Dávid Bolvanský ---
Or change -Os to be gcc10 -O2 with less inlining, -revert O2 to gcc9 -02 and
implement -Oz to create agressive “-Os”.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96337
--- Comment #10 from Dávid Bolvanský ---
>> Compiler version : GCC10.1.1
Maybe you want to use same GCC version as phoronix used (GCC 10.2)?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96337
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95042
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90949
--- Comment #18 from Dávid Bolvanský ---
Yes, PR95492
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
Test case from PR90949:
int puts(const char*);
void free(void*);
void* malloc(unsigned long);
#define NULL 0
struct Node
{
struct Node* child;
};
void walk(struct Node* module
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90949
--- Comment #16 from Dávid Bolvanský ---
For -O3 it is okay, but for -O2 this is questionable
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90949
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
struct S {
int i;
S& operator=(const S&) = delete;
};
S test(const S& s) { return
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93723
--- Comment #4 from Dávid Bolvanský ---
Thanks, created https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93798
Assignee: dmalcolm at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
Created attachment 47865
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47865&action=edit
preprocessed zstd source file
Using latest snapshot: gcc-latest
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93723
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93723
--- Comment #2 from Dávid Bolvanský ---
Without LTO
during IPA pass: analyzer
common/entropy_common.c: In function ‘HUF_readStats’:
common/entropy_common.c:196:37: internal compiler error: in
make_region_for_type, at analyzer/region-model.cc:598
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93721
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
++
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
Code:
void foo() {
char c = 255;
}
GCC:
warning: conversion from 'int' to 'char' changes value from '255' to
'\377' [
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89549
--- Comment #17 from Dávid Bolvanský ---
Check few lines above
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89549#c8
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89549
--- Comment #15 from Dávid Bolvanský ---
But there is no way to silence this "note".
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89549
--- Comment #12 from Dávid Bolvanský ---
This missed gcc 7.5 :/
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414
--- Comment #19 from Dávid Bolvanský ---
5 years...
Can anybody fix it? It is real issue on real world code:
https://reviews.llvm.org/D69792
UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
enum Kind : unsigned {
Y = 0x0,
N = 0x1,
Z = 0x2,
};
struct A {
K
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81334
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88814
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29776
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
++
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
Clang/ICC supports #pragma unroll (N) and it would be good if GCC too, so we
don't have to write macros to workaround it and to keep the code buildable by
all tree compilers.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91761
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
GCC fails to compile:
struct pixel {
int x;
int y;
};
struct master {
pixel pixel;
};
:9:11: error: declaration of '
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89549
--- Comment #11 from Dávid Bolvanský ---
Would be nice to fix this for the last release of GCC 7.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90885
--- Comment #20 from Dávid Bolvanský ---
Clang implemented [0] this diagnostic under -Wxor-used-as-pow.
From user perspective it would be reasonable if GCC follows this naming.
[0] https://reviews.llvm.org/D63423
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18487
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89549
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91185
Dávid Bolvanský changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91185
--- Comment #1 from Dávid Bolvanský ---
(gdb) r bw
Starting program: /home/xbolva00/IFJ16/src/ifj16c bw
Program received signal SIGSEGV, Segmentation fault.
0xeac5 in eval (op=0x55768b80) at interpret.c:37
37 tVar *a
: regression
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
tVar *eval(tVar *op)
{
if (unlikely(op == NULL))
return NULL;
tVar *a = op->offset + frame_stack.top->frame->local;
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90917
--- Comment #1 from Dávid Bolvanský ---
char f(void) {
char* s = ... ;
if (strcmp(global_s, s) == 0) return global_s[0];
return '-';
}
-->
char f2(void) {
char* s = ... ;
if (strcmp(global_s, s) == 0) return s[0];
return '-';
}
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
Motivation:
char f(char* s) {
if (strcmp(s, "test") == 0) return s[0];
return '-';
}
-
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90885
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90693
--- Comment #3 from Dávid Bolvanský ---
I measured it a bit..
(x-1)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90693
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
++
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
void alloc() {
int *arr = new int [10];
delete arr;
}
GCC with -Wall -Wextra - No warnings.
Clang with -Wall -Wextra:
:5:5: warning: 'delete' applied to a po
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
int vectorize(int b, unsigned *x, unsigned *y, int N, int NN)
{
int sum = 0;
int end = b ? N : NN;
unsigned *p = b
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90353
Dávid Bolvanský changed:
What|Removed |Added
CC||david.bolvansky at gmail dot
com
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
bool foo(int *a, int *b, unsigned n) {
memcpy(a, b, n);
return a == b;
}
GCC trunk X86-64
++
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
Test case:
#include
#include
using namespace std;
struct sort_heap
{
bool operator()(const int* lhs, const int* rhs) const
{
return *lhs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89738
--- Comment #2 from Dávid Bolvanský ---
#define PARENT_NODE(x) ((id - 1) / 2)
int id = 0;
int idx = 1;
PARENT_NODE(idx); // macro contais id, but id is defined, warn?
But probably such analysis is not so easy...
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
I found a nasty bug in my code which was related to unused macro arguments.
#define PARENT_NODE(x) ((id - 1) / 2)
As you can see, the "id" macro argument was unused. The code w
: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
#include
#include
typedef unsigned char byte_t;
void test (byte_t a, std::byte b)
{
printf("%u", a); // OK
printf("%hhu", a); // OK
printf("%u", b);
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89554
--- Comment #1 from Dávid Bolvanský ---
Another weird report:
Building CXX object lib/Lex/CMakeFiles/clangLex.dir/PPMacroExpansion.cpp.o
In file included from
/home/xbolva00/LLVM/llvm-project/clang/include/clang/Basic/SourceManager.h:37:0,
++
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
Found when building LLVM trunk with GCC 9 trunk (built today) compiler.
https://clang.llvm.org/doxygen/LiteralSupport_8cpp_source.html
const char *End = saw_exponent ? ExponentBegin
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89491
--- Comment #5 from Dávid Bolvanský ---
Let's take the original example with small modification:
int square(int x) { return x*x; }
int add(int x) { return x + x; }
typedef int (*p)(int);
static const p arr[4] = {square, add};
int test(int x) {
: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
GCC trunk -Wall -Wextra
#include
int foo(int *x) {
assert(x && "nullptr");
return *x;
}
int foo2(int *x) {
assert("nullptr"); // should warn
return *x;
}
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89491
--- Comment #2 from Dávid Bolvanský ---
Right, static helps.
What about more complex examples, like inlining vtables?
https://gcc.godbolt.org/z/ZXkRYa
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
int square(int x) {
return x*x;
}
int add(int x) {
return x + x;
}
typedef int (*p) (int);
p arr[4] = {square, add};
int test(int x) {
int res = arr[1](x);
return
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
bool foo(bool a, bool b)
{
if (a)
return true;
return b;
}
Current:
foo(bool, bool):
testdil, dil
mov eax, esi
cmovne
: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
GCC 8.2 Ubuntu build
Code from:
http://coliru.stacked-crooked.com/a/d59814e0765c3499
g++ -O3 file.cpp
Now:
warning: pack expansion in using-declaration only
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
Not sure how often this happens in the real world apps but anyway idea is..
int foo(void)
{
double *array
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
void Test()
{
int c = 0;
int in[4] = {4,3,4,4};
for (unsigned i = 0; i < 4; i++) {
for (unsigned j = 0; j < i; j++) {
if (in[i] =
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
-O3 -Wall -Werror -std=c++17
template< typename T = int > T func( );
template< typename T = int > T func( ) {
}
No war
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
void f(int n) {
void g(), h(), i();
switch (n) {
case 1:
case 2:
g();
[[fallthrough]];
case 3
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86701
--- Comment #2 from Dávid Bolvanský ---
There is not string analysis to tell us that string has no null characters in
the middle?
-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
Transform:
int lenstr(std::string &str) {
return strlen(str.c_str() /* .data() */);
}
To:
int lenstr(std::string &str) {
return str.length();
}
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86628
--- Comment #2 from Dávid Bolvanský ---
Something/0 is undefined behaviour
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
Hello,
for code:
int f(int x, int y, int z) {
return (x * y * z) / (y * z);
}
GCC 8.1 (x86-64) with -O3 emits:
f(int, int, int):
mov eax, edi
imul eax, esi
imul esi, edx
84 matches
Mail list logo