[Bug regression/40665] New: dereferencing type-punned pointer warnings cannot be disabled

2009-07-06 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
t gnu dot org ReportedBy: mikulas at artax dot karlin dot mff dot cuni dot cz GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40665

[Bug regression/40665] dereferencing type-punned pointer warnings cannot be disabled

2009-07-06 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #1 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-07 01:22 --- Created an attachment (id=18145) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18145&action=view) a bug in -Wstrict-aliasing=3 This is an example of a flaw in -Wstrict-aliasing=

[Bug regression/40665] dereferencing type-punned pointer warnings cannot be disabled

2009-07-06 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #2 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-07 01:34 --- Created an attachment (id=18146) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18146&action=view) a bug in -Wstrict-aliasing=3 This is an example of a flaw in -Wstrict-aliasing=

[Bug regression/40667] New: Performance regression: stack frames are generated even with -fomit-frame-pointer

2009-07-06 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
Status: UNCONFIRMED Severity: normal Priority: P3 Component: regression AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mikulas at artax dot karlin dot mff dot cuni dot cz GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu

[Bug regression/40665] dereferencing type-punned pointer warnings cannot be disabled

2009-07-07 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #7 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-07 16:31 --- > > extern int c; > > int a(void) > > { > >return *(short *)(void *)&c; > > } > > This is a very bad example of a false positive as you a

[Bug regression/40667] Performance regression: stack frames are generated even with -fomit-frame-pointer

2009-07-07 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #3 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-07 16:48 --- "Why do you limit your stack boundary artificially?" Because if I don't use FP code there is no point in aligning the stack. Aligning the stack wastes stack space and code s

[Bug regression/40665] dereferencing type-punned pointer warnings cannot be disabled

2009-07-07 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #8 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-07 16:45 --- > Thus code is undefined you have an acess of a char array as a struct. > Yes you are only taking the address of an element but it is still > considered an acess by the standards.

[Bug regression/40665] dereferencing type-punned pointer warnings cannot be disabled

2009-07-07 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #10 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-07 18:07 --- So you mean that that ->x operator is invalid and break the standard? Anyway the standard means "if you write your code according to the standard => the code will run correctl

[Bug regression/40665] dereferencing type-punned pointer warnings cannot be disabled

2009-07-07 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #12 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-07 19:40 --- So if there was char *buffer = malloc(512) instead of char buffer[512], would it be correct to cast it to the pointer to structure? > And it is not about the cast between the pointer ty

[Bug rtl-optimization/40667] [4.4/4.5 Regression] stack frames are generated even with -fomit-frame-pointer

2009-07-23 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #15 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-23 11:12 --- The patch just walks around the problem and doesn't really fix it. It is simply a hack that disables frame generation for long long, while for the other types the same problem per

[Bug rtl-optimization/40667] [4.4/4.5 Regression] stack frames are generated even with -fomit-frame-pointer

2009-07-23 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #16 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-23 11:18 --- In the above example, the output of assembler is: f: pushl %ebp movl%esp, %ebp subl$8, %esp fldl8(%ebp) fstpl (%esp) callg

[Bug rtl-optimization/40667] [4.4/4.5 Regression] stack frames are generated even with -fomit-frame-pointer

2009-07-23 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #18 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-23 12:16 --- The bug is this: you don't align the stack and you generate the frame. Why? Why don't you do one of these?: * generate the frame and align * don't generate the frame and don

[Bug rtl-optimization/40838] New: gcc shouldn't assume that the stack is aligned

2009-07-23 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mikulas at artax dot karlin dot mff dot cuni dot cz GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet:

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-07-23 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #3 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-23 13:15 --- What I would propose to fix this and bug #40667: Each type has required alignment and preferred alignment. Enforced alignment is what is needed to not crash and not violate the ABI, preferred

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-07-23 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #4 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-23 13:19 --- "Linux/ix86 ABI says that stack must be 16 byte aligned." No it doesn't. There is a plenty of Linux code that doesn't have the stack aligned on 16-byte boundary. (at lea

[Bug rtl-optimization/40667] [4.4/4.5 Regression] stack frames are generated even with -fomit-frame-pointer

2009-07-23 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #20 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-23 13:28 --- I see, if it gets spilled to the stack as a local variable, it realigns the stack, if it doesn't get spilled, it doesn't. But shouldn't "passing the variable as an argum

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-07-23 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #7 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-23 13:49 --- See bug #27537, quoting "GNU/Linux follows the SYSV x86 ABI which is documented, maybe you cannot find it but it does exist. The SYSV x86 ABI says the stack is aligned 4 byte aligned.&q

[Bug target/38496] Gcc misaligns arrays when stack is forced follow the x8632 ABI

2009-07-23 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #23 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-23 14:34 --- So, Joseph is basically arguing that it doesn't make sense to follow bad standards. Fine. So let's ignore the "i386 ABI standard" thing for a moment a look at the chang

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-07-23 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #10 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-23 14:36 --- Jakub: so try that "test $15, %esp; jnz abort" at every function, as I proposed in bug #38496. There are much more places that will trigger this. Just go catch them. -- http://g

[Bug rtl-optimization/40906] New: Wrong code generated for push of long double

2009-07-29 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
Priority: P3 Component: rtl-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mikulas at artax dot karlin dot mff dot cuni dot cz GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://

[Bug rtl-optimization/40906] Wrong code generated for push of long double

2009-07-29 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #1 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-29 17:07 --- Created an attachment (id=18270) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18270&action=view) A patch for the bug A patch for the problem. 1. reverse the direc

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-07-30 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #11 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-31 01:00 --- So I did this experiment whether the stack is aligned in current Linux binaries. I applied this patch for gcc, so that it crashes on function entry if the function has stack not aligned on 16

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-07-30 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #12 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-31 01:04 --- Created an attachment (id=18276) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18276&action=view) Crash because gcc assumes false stack alignment Here I'm submitting an

[Bug target/38496] Gcc misaligns arrays when stack is forced follow the x8632 ABI

2009-07-30 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #26 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-31 01:18 --- Very unfortunatelly, gcc does assume stack alignment. The problem is not technical (the code to realign the stack is already there, it's easy to activate it), the problem is ideolo

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-07-31 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #14 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-31 13:54 --- Jakub: And how many other "bugs" like this are there? 75% of binaries in /bin are "buggy". Do you think it is really sensible to declare that majority of Linux software is

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-07-31 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #16 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-31 15:22 --- H.J. Lu: No, you only have to align the stack in functions that do 16-byte SSE. I mean this: there are two possible reasons for aligning the stack 1) improved performance (double, long

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-07-31 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #17 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-31 15:31 --- "Even if we align the incoming stack properly, we still have to align the outgoing stack to 16byte" I'm not opposing it. What I mean is: every function will have stack fra

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-07-31 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #19 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-31 16:17 --- (In reply to comment #18) Yes. But not an option. Make it default and make it optional to disable the alignment. Make it default, because such option would be useless if all libraries didn&#

[Bug middle-end/40943] New: Uninitialized warning is missed when dereferencing uninitialized pointers

2009-08-02 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
ncing uninitialized pointers Product: gcc Version: 4.4.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mikulas at artax dot karlin do

[Bug target/40983] New: The scheduler incorrectly swaps MMX and floating point instructions

2009-08-05 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
instructions Product: gcc Version: 4.4.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mikulas at artax dot karlin dot mff dot cuni dot cz GCC

[Bug target/40983] The scheduler incorrectly swaps MMX and floating point instructions

2009-08-05 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #1 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-08-06 04:12 --- Created an attachment (id=18310) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18310&action=view) A failing example -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40983

[Bug target/40983] The scheduler incorrectly swaps MMX and floating point instructions

2009-08-05 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #2 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-08-06 04:15 --- Assembler output: f: pushl %ebp movl%esp, %ebp subl$16, %esp movq%mm0, -8(%ebp) movq%mm1, -16(%ebp) emms fldla

[Bug rtl-optimization/40667] [4.4/4.5 Regression] stack frames are generated even with -fomit-frame-pointer

2009-08-08 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #21 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-08-08 10:41 --- Hmm, it still generates the stack frame (and the alignment itself) when there are structures containing long long and with -malign-double. Example, compile with -O2 -fomit-frame-pointer

[Bug rtl-optimization/40667] [4.4/4.5 Regression] stack frames are generated even with -fomit-frame-pointer

2009-08-08 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #23 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-08-08 14:15 --- (In reply to comment #22) > It is because -malign-double will align long long to 8 byte. Yes, it aligns it in the structures ... but why on the stack? Those people who were writing it rea

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-08-08 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #23 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-08-08 17:30 --- (In reply to comment #21) Unfortunatelly, that patch is wrong. It aligns when there is some vector type in the function but it doesn't align if the autovectorizer creates SSE instruc

[Bug target/41013] New: Fastcall calling convention is incompatible with Windows

2009-08-09 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
Product: gcc Version: 4.4.1 Status: UNCONFIRMED Severity: minor Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mikulas at artax dot karlin dot mff dot cuni dot cz GCC build triplet: i686-pc-

[Bug target/41013] Fastcall calling convention is incompatible with Windows

2009-08-09 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #1 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-08-09 13:39 --- "an argument that has integer type" should really be "an argument that has integer or pointer type" ... pointers are passed in registers too. Anything else isn'

[Bug target/41017] New: regparm=3 passes structures inconsistently

2009-08-09 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mikulas at artax dot karlin dot mff dot cuni dot cz GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzil

[Bug target/41017] regparm=3 passes structures inconsistently

2009-08-09 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #1 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-08-09 18:40 --- Created an attachment (id=18331) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18331&action=view) a proposed patch. Fixed bug 41013 as well. Change it so that all the aggregat

[Bug target/41017] regparm=3 passes structures inconsistently

2009-08-09 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #4 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-08-09 21:16 --- Regparm changed between gcc 3.x -> 4.x (I remember it too painfully, I had to rewrite some assembler files). In 3.x, all arguments were incrementing register count, even if they were on st

[Bug target/41017] regparm=3 passes structures inconsistently

2009-08-10 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #7 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-08-10 19:36 --- Worse, try to return these structures with -freg-struct-return and it also follows this inconsistent pattern, some are returned in EAX:EDX, some are returned in ST(0). It is even inconsistent

[Bug target/41017] regparm=3 passes structures inconsistently

2009-08-11 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #8 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-08-11 20:38 --- Created an attachment (id=18341) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18341&action=view) A patch for -freg-struct-return Another patch that makes -freg-struct-return con

[Bug target/41017] regparm=3 passes structures inconsistently

2009-08-11 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #9 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-08-11 20:40 --- The Basic rule implemented in both patches is: when you have aggregate type, you MUST NOT look at mode to infer parameter or return method. It is unreliable. -- http://gcc.gnu.org/bugzilla

[Bug target/41013] Fastcall calling convention is incompatible with Windows

2009-08-11 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #2 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-08-11 20:48 --- Another inconsistency: struct { float f }; is returned in ST(0) in GCC and in EAX on Windows. struct { double f }; is returned in ST(0) in GCC and in EDX:EAX on Windows. See PR 41017 for more

[Bug rtl-optimization/40667] [4.4/4.5 Regression] stack frames are generated even with -fomit-frame-pointer

2009-08-11 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #24 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-08-11 21:01 --- Another case when stack frame is spuriously generated: /* -O2 -fomit-frame-pointer -mno-accumulate-outgoing-args */ void __attribute__((__noreturn__)) crash(__const__ char *, ...); void F

[Bug c/20645] New: Complilation success depends on optimization being used

2005-03-25 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
Summary: Complilation success depends on optimization being used Product: gcc Version: 3.4.3 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mikula

[Bug target/35504] New: incorrect code generated on i386 for C++ multiple inheritance, large return structures and regparm or fastcall calling conventions

2008-03-07 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mikulas at artax dot karlin dot mff dot cuni dot cz GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686

[Bug target/35504] incorrect code generated on i386 for C++ multiple inheritance, large return structures and regparm or fastcall calling conventions

2008-03-07 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #1 from mikulas at artax dot karlin dot mff dot cuni dot cz 2008-03-08 04:51 --- Created an attachment (id=15279) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15279&action=view) A testcase for the bug A testcase for thunk functions with all calling conventi

[Bug target/35504] incorrect code generated on i386 for C++ multiple inheritance, large return structures and regparm or fastcall calling conventions

2008-03-07 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #2 from mikulas at artax dot karlin dot mff dot cuni dot cz 2008-03-08 04:55 --- Created an attachment (id=15280) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15280&action=view) a patch for the bug A patch for gcc 4.3.0. When the function returns an aggregat

[Bug target/40983] The scheduler incorrectly swaps MMX and floating point instructions

2009-08-23 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #4 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-08-23 19:18 --- The patch works fine. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40983

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-08-23 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #30 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-08-23 19:28 --- I tested the 4.4 patch and it works fine. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40838

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-09-13 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #32 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-09-13 13:58 --- Created an attachment (id=18578) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18578&action=view) A bug example for 4.4 patch Shows a bug in 4.4 patch -- http://gcc.

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-09-13 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #33 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-09-13 13:59 --- Created an attachment (id=18579) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18579&action=view) Another bug in 4.4 patch Another bug in 4.4 patch. -- http://gcc.gnu.org/b

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-09-13 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #34 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-09-13 14:07 --- So I posted these two examples that show that the patch is insufficient: 1) if the array is embedded in a structure and that structure is on the stack, the stack is not aligned. (if the array

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-09-19 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #39 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-09-20 06:30 --- The updated patch fixes align-counterexample1.c, but not align-counterexample2.c. Note that you must align the stack for all functions that have some SSE operations, because you never know if

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-09-23 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #43 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-09-23 16:28 --- With the patch from comment #41, my test examples pass but seamonkey is still miscompiled, the function pow5mult still doesn't align the stack and spills xmm0 on it. -- http://gcc.gn

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-09-24 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #46 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-09-25 00:56 --- Created an attachment (id=18646) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18646&action=view) A patch for gcc 4.4.1 I decided to make a patch on my own. Seamonkey works with

[Bug middle-end/41475] New: common variables cannot be expected to be aligned

2009-09-25 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
ent: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mikulas at artax dot karlin dot mff dot cuni dot cz GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41475

[Bug middle-end/41475] common variables cannot be expected to be aligned

2009-09-25 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #1 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-09-26 04:05 --- Created an attachment (id=18653) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18653&action=view) the first file The first file of a two-file program. Compile with gcc -c -O3

[Bug middle-end/41475] common variables cannot be expected to be aligned

2009-09-25 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #2 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-09-26 04:06 --- Created an attachment (id=18654) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18654&action=view) the second file The second file. Compile with gcc -c -Os. Then, link both objec

[Bug middle-end/41475] common variables cannot be expected to be aligned

2009-09-25 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #3 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-09-26 04:14 --- BTW. this bug is in both gcc 4.3 and 4.4 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41475

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-09-25 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #48 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-09-26 04:25 --- It can be seen from the patch. I don't know how to detect that a structure contains an array with required SSE align, so I realign the stack for all types BLKmode with alignment >=

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-09-26 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #50 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-09-26 15:44 --- > Please find a testcase first. Otherwise, nothing will be done. Thanks. I don't want anything to be done (unless the patch causes generation of wrong code --- I am not aware of s

[Bug middle-end/41475] common variables cannot be expected to be aligned

2009-09-26 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #7 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-09-26 15:27 --- Richard Guenther: the bug caused by common symbol (in file commonalign1.o) with the same name as data section symbol (in file commonalign2.o). In this case, the linker redirects the common

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-09-27 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #54 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-09-27 09:03 --- (In reply to comment #51) For 4.4, the designers held two wrong assumptions: 1) the incoming stack is always aligned on -mincoming-stack-boundary (wrong for functions called from assembler

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-09-27 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #55 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-09-27 09:07 --- "If we assume incoming stack is 4byte aligned, we have to realign stack for every function due to #2, which isn't acceptable." No, you don't. All you have to do is to allo

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-09-27 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #56 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-09-27 09:36 --- As for this "old code that assumes 16-byte alignment": this is wrong code generated by old versions of gcc. It only works as long as it is called from other gcc >= 3 code (call it

[Bug middle-end/41475] common variables cannot be expected to be aligned

2009-09-27 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #9 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-09-27 09:51 --- The common linker definitions were made to exactly to make code like this work and share the array between two object. So if you think it is undefined, don't support it (make -fno-c

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-10-15 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #58 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-10-15 20:24 --- (In reply to comment #53) > Created an attachment (id=18656) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18656&action=view) [edit] > An updated patch for gcc 4.4 Seamonk

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2009-10-15 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #61 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-10-16 02:10 --- > Why should gcc align the stack when SSE registers aren't used > at all? Because it passes pointer to the structure containing vector entries to someone else who expects it to

[Bug target/41900] New: call *%esp shouldn't be generated because of CPU errata

2009-11-01 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
ReportedBy: mikulas at artax dot karlin dot mff dot cuni dot cz GCC build triplet: i486-linux-gnu GCC host triplet: i486-linux-gnu GCC target triplet: i486-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41900

[Bug middle-end/41992] New: ICE on invalid dereferencing of void *

2009-11-08 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
ereferencing of void * Product: gcc Version: 4.4.1 Status: UNCONFIRMED Severity: minor Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mikulas at artax dot karlin dot mff dot cuni do

[Bug middle-end/41992] ICE on invalid dereferencing of void *

2009-11-11 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #3 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-11-11 21:06 --- You can dereference void * in asm arguments --- i.e. void *p; ... asm volatile ("prefetch %0"::"m"(*p)); gcc warns in this case about the dereference and maybe it shouldn

[Bug target/40983] The scheduler incorrectly swaps MMX and floating point instructions

2009-11-11 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #6 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-11-11 23:06 --- I think you can commit it to gcc. I don't see a reason why it shouldn't be committed. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40983

[Bug target/40667] [4.4/4.5 Regression] stack frames are generated even with -fomit-frame-pointer

2010-02-15 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #26 from mikulas at artax dot karlin dot mff dot cuni dot cz 2010-02-15 10:34 --- Comment #25: I don't understand your logic, what does attribute((noreturn)) have to do with a stack frame? The only valid reasons for generating a stack frame are alloca() or needed

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2010-04-20 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #68 from mikulas at artax dot karlin dot mff dot cuni dot cz 2010-04-20 07:48 --- gcc 4.5 is affected too. It would be nice if they fixed it. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40838

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2010-08-17 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #80 from mikulas at artax dot karlin dot mff dot cuni dot cz 2010-08-17 20:17 --- Comment #79: -mpreferred-stack-boundary=2 adheres to the sysv ABI but it doesn't adhere to the Linux ABI (that requires 16-byte alignment), so if you compile anything with -mpreferred-

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2010-08-17 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #82 from mikulas at artax dot karlin dot mff dot cuni dot cz 2010-08-17 21:17 --- -mstackrealign is available from gcc 4.5.0. For gcc 4.4 you can use my patch GCC-4.4.1-ALIGN-PATCH from this bugzilla or H.J.Lu's last patch. It basically does the same as -mstackrealign

[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned

2010-08-25 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #84 from mikulas at artax dot karlin dot mff dot cuni dot cz 2010-08-25 21:27 --- (In reply to comment #83) If the bug is not related to stack alignment (i.e. it crashes not on unaligned SSE access), simplify it and file another bugzilla entry. -- http://gcc.gnu.org

[Bug target/12081] Gcc can't be compiled with -mregparm=3

2007-10-28 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Comment #16 from mikulas at artax dot karlin dot mff dot cuni dot cz 2007-10-28 16:09 --- Subject: Re: Gcc can't be compiled with -mregparm=3 > arguments the function receives. We have gen_* functions taking 0, 1, 2, 3, > ... > arguments and with GCC being designed

[Bug other/36781] New: gcc can't be compiled in an environment that requires CFLAGS

2008-07-09 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
er AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mikulas at artax dot karlin dot mff dot cuni dot cz GCC build triplet: sparc64-unknown-linux-gnu GCC host triplet: sparc64-unknown-linux-gnu GCC target triplet: sparc64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36781

[Bug rtl-optimization/21299] New: internal error on invalid asm statement (3.2, 3.3, 3.4, 4.0)

2005-04-30 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
Priority: P2 Component: rtl-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mikulas at artax dot karlin dot mff dot cuni dot cz CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linu

[Bug c/18063] New: Gcc doesn't check overflowed size of structure

2004-10-19 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
iority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mikulas at artax dot karlin dot mff dot cuni dot cz CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triple

[Bug c/18063] Gcc doesn't check overflowed size of structure

2004-10-19 Thread mikulas at artax dot karlin dot mff dot cuni dot cz
--- Additional Comments From mikulas at artax dot karlin dot mff dot cuni dot cz 2004-10-19 17:32 --- Subject: Re: Gcc doesn't check overflowed size of structure If you rewrite it to int main(void) { size_t c = sizeof(struct a); struct a *b = malloc(c); r