or -O2 used
Product: gcc
Version: 4.3.2
Status: UNCONFIRMED
Severity: critical
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: socketpair at gmail dot com
GCC build triplet: i386
GCC host triplet: i386
GCC target triplet: i386
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38616
--- Comment #1 from socketpair at gmail dot com 2008-12-24 13:27 ---
Created an attachment (id=16979)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16979&action=view)
assembler output of wrong generated code
this assembler output generates only 8 characters in output ins
--- Comment #2 from socketpair at gmail dot com 2008-12-24 13:33 ---
(From update of attachment 16979)
.file "zzz2.c"
.text
.p2align 4,,15
.globl main
.type main, @function
main:
leal4(%esp), %ecx
andl$-16, %esp
--- Comment #3 from socketpair at gmail dot com 2008-12-24 13:38 ---
(From update of attachment 16979)
(i'm not intentionally send assembler output for version where buf[1024]
replaced with buf[1023]).
--
socketpair at gmail dot com changed:
What|Re
--- Comment #5 from socketpair at gmail dot com 2008-12-24 15:21 ---
-fno-stack-protector really helps.
i don't understand why "rep stosl" appear in the middle of string
initialization..
gdb said that "rep stosl" is a cause of zero byte after first 8 symbols
--- Comment #6 from socketpair at gmail dot com 2008-12-24 15:28 ---
> -fno-fstack-protector is a work around. Ubuntu must enable stack protector by
default.
I don't understand. Ubuntu enabled stack protector by default now. Is this
error?
Should i report bug to Ubuntu?
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54340
Bug #: 54340
Summary: internal compiler error: Illegal instruction (int
main() returns nothing, only when -O2/-O3 used)
Classification: Unclassified
Product: gcc
Version: 4.6.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54340
--- Comment #3 from Коренберг Марк 2012-08-21
07:32:25 UTC ---
Yes, I tested on gentoo, no error appear.
I have reported to ubuntu bug tracker:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.6/+bug/1039401
: unassigned at gcc dot gnu dot org
ReportedBy: socketpair at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41749
--- Comment #1 from socketpair at gmail dot com 2009-10-19 07:14 ---
gcc322 generates this:
(gcc -Os -fomit-frame-pointer qwe.c --save-temps)
main:
movl$1, %eax
Assignee: unassigned at gcc dot gnu.org
Reporter: socketpair at gmail dot com
Target Milestone: ---
Consider this program:
=
#include
#include
#include
int main() {
char buf[128];
if (scanf("%s", buf) != 1) return 42;
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70308
--- Comment #2 from Коренберг Марк ---
Please read carefully. All conditions are the same, except different branching.
So, gcc choose "rep stosl" by unknown cause.
Severity: normal
Priority: P3
Component: lto
Assignee: unassigned at gcc dot gnu.org
Reporter: socketpair at gmail dot com
Target Milestone: ---
Original bug was reported here:
https://github.com/thom311/libnl/issues/93
libnl3 have such function:
static void
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68902
--- Comment #2 from Коренберг Марк ---
https://sourceware.org/bugzilla/show_bug.cgi?id=19372
Severity: minor
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: socketpair at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45340
--- Comment #1 from socketpair at gmail dot com 2010-08-19 14:17 ---
Created an attachment (id=21519)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21519&action=view)
C souce file
1. gcc-Os --save-temps -fomit-frame-pointer -fno-stack-protector main.c
2. gcc -DC
--- Comment #2 from socketpair at gmail dot com 2010-08-19 14:28 ---
Created an attachment (id=21520)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21520&action=view)
with stupid jmp
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45340
--- Comment #3 from socketpair at gmail dot com 2010-08-19 14:28 ---
Created an attachment (id=21521)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21521&action=view)
without buggy jmp
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45340
--- Comment #5 from socketpair at gmail dot com 2010-08-24 03:35 ---
> There is nothing the compiler can do really.
Why ?
I compared assembler listings with likely() swapped with unlikely(). As I
suggest, it helps to choose between je and jne in each case, and other
circumstances
--- Comment #7 from socketpair at gmail dot com 2010-08-25 12:23 ---
Well, I understand that problem is not in __builtin_expect.
Should I open new, separate bug about block reordering and generating "jmp to
next line" ?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45340
Product: gcc
Version: 4.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: inline-asm
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: socketpair at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43998
--- Comment #3 from socketpair at gmail dot com 2010-05-06 11:00 ---
Thanks alot, but I think it is bug in gcc inline assembler. I think I wrote
correct asm() line.
I know about cpuid.h
I listed this instruction just as example.
--
socketpair at gmail dot com changed
--- Comment #5 from socketpair at gmail dot com 2010-05-06 11:41 ---
Well, how to say that to compiler:
This instruction receives input in register eax, but after executing it, eax
value will be corrupted. I don't need this new value, but compiler should not
think that e
--- Comment #7 from socketpair at gmail dot com 2010-05-06 13:42 ---
> Just make eax both input and output.
it's not optimal. gcc will try to preserve new eax value. So it will not use
eax register in next instructions. If eax is really need, it will save it in
esi, edi or so o
--- Comment #9 from socketpair at gmail dot com 2010-05-06 15:03 ---
> Not if you make the output unused by not using it.
I do not understand why gcc distinguish between 'specifying register as output'
and 'specifying as clobbering'.
I always considered, that
Version: unknown
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: socketpair at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44094
--- Comment #11 from socketpair at gmail dot com 2010-05-14 06:31 ---
Suppose this:
volatile int x;
asm("something"::"a" (1))
x=1;
the compiler may think that "something" do not modify eax. So next assignment
may use eax ( mov eax, x ). So, "it
-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: socketpair at gmail dot com
Target Milestone: ---
https://godbolt.org/z/s3j8jK6ca
```
#include
int firewall1(const uint8_t *restrict data) {
const uint8_t ip_proto = *data;
const uint16_t dst_port = *((const
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108418
--- Comment #1 from Коренберг Марк ---
Sorry, but such kind of code happens as a result of C-code automatic
generation.
Component: regression
Assignee: unassigned at gcc dot gnu.org
Reporter: socketpair at gmail dot com
Target Milestone: ---
See https://godbolt.org/z/rTfTondfP
```
#include
int firewall(const uint8_t *restrict data) {
const uint8_t ip_proto = *data;
const uint16_t dst_port
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767
--- Comment #1 from Коренберг Марк ---
See assembler output for firewall2(). It's not -Os optimized (compare to
firewall(), which is ok)
```
firewall:
movw64(%rdi), %ax
cmpb$17, (%rdi)
sete%cl
leal
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767
--- Comment #3 from Коренберг Марк ---
I forgot to add. gcc 12.2 - everything is OK. gcc 13 - with bug.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767
--- Comment #5 from Коренберг Марк ---
Not only -s problem. I think -O3 in gcc 12.2 will run faster than -O3 in gcc 13
(for this case). this code should not be treated as if-else-if-else-if. gcc 12
does its job right.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767
--- Comment #8 from Коренберг Марк ---
Okay, but why switch-case is not handled using fast implementation using masks
(when difference between smallest and biggest integer <=64 ?
See the first function in my first message where it works as expe
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: socketpair at gmail dot com
Target Milestone: ---
https://godbolt.org/z/5e3eKqPqs
```C
#include
int firewall3(const uint8_t *restrict data) {
const uint32_t src = *((const uint32_t *)data);
if
++
Assignee: unassigned at gcc dot gnu.org
Reporter: socketpair at gmail dot com
Target Milestone: ---
Yes, I saw #35806, #41175 and others.
See https://godbolt.org/z/Pnh89Y3Yb
```
#include
using namespace std;
int main(int argc, char* argv[]) {
if (argv[0] == nullptr
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: socketpair at gmail dot com
Target Milestone: ---
https://godbolt.org/z/d46448vqa
-std=c++23 -O3 -fno-exceptions
37 matches
Mail list logo