[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-13 Thread janis at gcc dot gnu dot org
--- Comment #50 from janis at gcc dot gnu dot org 2009-03-13 17:05 --- Subject: Bug 39137 Author: janis Date: Fri Mar 13 17:05:08 2009 New Revision: 144841 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=144841 Log: 2009-03-13 Jack Howarth howa...@bromo.med.uc.edu PR

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-12 Thread Joey dot ye at intel dot com
--- Comment #47 from Joey dot ye at intel dot com 2009-03-12 06:51 --- (In reply to comment #46) Created an attachment (id=17444) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17444action=view) [edit] gcc.target/i386/stackalign/longlong-2.c for -mnostackalign on darwin10

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-12 Thread rguenth at gcc dot gnu dot org
--- Comment #48 from rguenth at gcc dot gnu dot org 2009-03-12 09:43 --- If it ignores -mpreferred-stack-boundary it shouldn't end up setting ix86_preferred_stack_boundary to the ignored value. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39137

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-12 Thread hjl dot tools at gmail dot com
--- Comment #49 from hjl dot tools at gmail dot com 2009-03-12 13:30 --- (In reply to comment #48) If it ignores -mpreferred-stack-boundary it shouldn't end up setting ix86_preferred_stack_boundary to the ignored value. i386/darwin.h has /* On Darwin, the stack is 128-bit aligned

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-11 Thread rguenth at gcc dot gnu dot org
--- Comment #36 from rguenth at gcc dot gnu dot org 2009-03-11 14:47 --- In reply to comment #34, we should be able to fixup alignment in get_decl_align_unit if DECL_USER_ALIGN is set (or change the prototype for LOCAL_ALIGNMENT to take a decl and/or a type). I wonder why we have both

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-11 Thread jakub at gcc dot gnu dot org
--- Comment #37 from jakub at gcc dot gnu dot org 2009-03-11 16:26 --- Created an attachment (id=17440) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17440action=view) gcc44-pr39137.patch Patch I'm going to bootstrap/regtest now. I've re-added the TYPE_USER_ALIGN check, because

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-11 Thread jakub at gcc dot gnu dot org
--- Comment #38 from jakub at gcc dot gnu dot org 2009-03-11 17:14 --- Created an attachment (id=17442) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17442action=view) gcc44-pr39137-2.patch Alternative patch which does stack realignment in f[2345] rather than just in f[345]. --

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-11 Thread hjl dot tools at gmail dot com
--- Comment #39 from hjl dot tools at gmail dot com 2009-03-11 17:17 --- (In reply to comment #38) Created an attachment (id=17442) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17442action=view) [edit] gcc44-pr39137-2.patch Alternative patch which does stack realignment in

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-11 Thread rguenth at gcc dot gnu dot org
--- Comment #40 from rguenth at gcc dot gnu dot org 2009-03-11 20:04 --- Both patches look ok to me. For 4.5 we might want to consider merging some of the target hooks though. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39137

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-11 Thread jakub at gcc dot gnu dot org
--- Comment #41 from jakub at gcc dot gnu dot org 2009-03-11 21:12 --- Subject: Bug 39137 Author: jakub Date: Wed Mar 11 21:12:33 2009 New Revision: 144792 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=144792 Log: PR target/39137 * cfgexpand.c

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-11 Thread jakub at gcc dot gnu dot org
--- Comment #42 from jakub at gcc dot gnu dot org 2009-03-11 21:23 --- Fixed. -- jakub at gcc dot gnu dot org changed: What|Removed |Added Status|NEW

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-11 Thread howarth at nitro dot med dot uc dot edu
--- Comment #43 from howarth at nitro dot med dot uc dot edu 2009-03-12 00:41 --- On darwin10, I am seeing... Executing on host: /sw/src/fink.build/gcc44-4.3.999-20090311/darwin_objdir/gcc/xgcc -B/sw/src/fink.build/gcc44-4.3.999-20090311/darwin_objdir/gcc/

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-11 Thread hjl dot tools at gmail dot com
--- Comment #44 from hjl dot tools at gmail dot com 2009-03-12 00:44 --- Those tests should be skipped on MacOS since it ignores -mpreferred-stack-boundary=2. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39137

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-11 Thread howarth at nitro dot med dot uc dot edu
--- Comment #45 from howarth at nitro dot med dot uc dot edu 2009-03-12 00:45 --- Created an attachment (id=17443) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17443action=view) gcc.target/i386/stackalign/longlong-2.c for -mstackalign on darwin10

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-11 Thread howarth at nitro dot med dot uc dot edu
--- Comment #46 from howarth at nitro dot med dot uc dot edu 2009-03-12 00:46 --- Created an attachment (id=17444) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17444action=view) gcc.target/i386/stackalign/longlong-2.c for -mnostackalign on darwin10

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-03 Thread jakub at gcc dot gnu dot org
--- Comment #32 from jakub at gcc dot gnu dot org 2009-03-03 10:36 --- I don't see the reason for optimize_function_for_size_p (cfun), care to back up with benchmarks that forcing dynamic realignment for long long variables with -mpreferred-stack-boundary=2 improves performance rather

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-03 Thread hjl dot tools at gmail dot com
--- Comment #33 from hjl dot tools at gmail dot com 2009-03-03 14:48 --- (In reply to comment #32) I don't see the reason for optimize_function_for_size_p (cfun), care to back up with benchmarks that forcing dynamic realignment for long long variables with

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-03 Thread jakub at gcc dot gnu dot org
--- Comment #34 from jakub at gcc dot gnu dot org 2009-03-03 16:01 --- Yeah, unsigned long long l __attribute__ ((aligned(8))); won't be 64-bit aligned with -m32 -mpreferred-stack-boundary=2, but I think that's not a big deal and isn't a regression from 4.3 and earlier anyway. --

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-03-03 Thread Joey dot ye at intel dot com
--- Comment #35 from Joey dot ye at intel dot com 2009-03-04 01:41 --- (In reply to comment #32) I don't see the reason for optimize_function_for_size_p (cfun), care to back up with benchmarks that forcing dynamic realignment for long long variables with

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-22 Thread hubicka at gcc dot gnu dot org
--- Comment #29 from hubicka at gcc dot gnu dot org 2009-02-22 18:46 --- I mean aligned(64). I guess something like this then? Index: config/i386/i386.c === --- config/i386/i386.c (revision 144373) +++ config/i386/i386.c

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-22 Thread hjl dot tools at gmail dot com
--- Comment #30 from hjl dot tools at gmail dot com 2009-02-22 19:28 --- (In reply to comment #29) I mean aligned(64). I guess something like this then? Index: config/i386/i386.c === --- config/i386/i386.c (revision

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-22 Thread Joey dot ye at intel dot com
--- Comment #31 from Joey dot ye at intel dot com 2009-02-23 03:15 --- How about this patch? 1. Only reduce DI mode when -Os 2. Ignore TYPE_USER_ALIGN, so that stack realign happens for case in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39137#c28, which IMHO is acceptable. Index:

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-21 Thread hubicka at gcc dot gnu dot org
--- Comment #26 from hubicka at gcc dot gnu dot org 2009-02-21 13:00 --- I had somehting along this lines in mind: Index: config/i386/i386.c === *** config/i386/i386.c (revision 144352) --- config/i386/i386.c (working

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-21 Thread rguenth at gcc dot gnu dot org
--- Comment #27 from rguenth at gcc dot gnu dot org 2009-02-21 13:05 --- That patch looks reasonable. Care to bootstrap/test it to settle this last P1? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39137

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-21 Thread hjl dot tools at gmail dot com
--- Comment #28 from hjl dot tools at gmail dot com 2009-02-21 15:38 --- (In reply to comment #26) I had somehting along this lines in mind: Index: config/i386/i386.c === *** config/i386/i386.c (revision 144352) ---

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-17 Thread Joey dot ye at intel dot com
--- Comment #20 from Joey dot ye at intel dot com 2009-02-17 09:18 --- (In reply to comment #19) Just for the record, here is an unsuccessful attempt to avoid stack realignment just because of DImode for -m32 or because of DFmode at -m32 -Os. This patch unfortunately caused a

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-17 Thread jakub at gcc dot gnu dot org
--- Comment #21 from jakub at gcc dot gnu dot org 2009-02-17 09:29 --- Unless you consider that option being -mpreferred-stack-boundary=2. By default stack boundary is bigger and so DImode is aligned naturally, it is only when you want very compat code that you use this option. --

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-17 Thread hjl dot tools at gmail dot com
--- Comment #22 from hjl dot tools at gmail dot com 2009-02-17 14:52 --- -mpreferred-stack-boundary=2 can also be used to generate psABI conforming code. I think we need a new option to align DImode to 4 byte on stack if we want to change DImode alignment on stack. --

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-17 Thread jakub at gcc dot gnu dot org
--- Comment #23 from jakub at gcc dot gnu dot org 2009-02-17 15:25 --- I guess I can live with a switch, the kernel folks will just need to add it. Now, should that switch be about disabling all dynamic stack realignments, or do that for DImode only, or decrease DImode alignment when on

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-17 Thread hjl dot tools at gmail dot com
--- Comment #24 from hjl dot tools at gmail dot com 2009-02-17 15:40 --- (In reply to comment #23) I guess I can live with a switch, the kernel folks will just need to add it. Now, should that switch be about disabling all dynamic stack realignments, or do that for DImode only, or

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-17 Thread hjl dot tools at gmail dot com
--- Comment #25 from hjl dot tools at gmail dot com 2009-02-17 17:29 --- Created an attachment (id=17311) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17311action=view) A patch to add a new -malign-long-long= option Here is a patch to add a new option, -malign-long-long=. --

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-13 Thread jakub at gcc dot gnu dot org
--- Comment #19 from jakub at gcc dot gnu dot org 2009-02-13 19:15 --- Created an attachment (id=17296) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17296action=view) Unsuccessful attempt to avoid stack realignment for DImode and for DFmode at -Os Just for the record, here is an

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-12 Thread jakub at gcc dot gnu dot org
--- Comment #14 from jakub at gcc dot gnu dot org 2009-02-12 08:03 --- Won't this break Ada again (with -malign-double=2)? I think we should reject -malign-double= for -m64. Alternatively, what about making MAX_STACK_ALIGNMENT a parameter instead, so kernel could use

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-12 Thread hubicka at gcc dot gnu dot org
--- Comment #15 from hubicka at gcc dot gnu dot org 2009-02-12 16:47 --- The DFmode and DImodes are different. Aligning DFmode on stack is very performance critical, while DImodes on 32bit machine can quite safely be misaligned (if we ignore their possible use in MMX intrincisc). I

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-12 Thread hjl dot tools at gmail dot com
--- Comment #16 from hjl dot tools at gmail dot com 2009-02-12 17:01 --- (In reply to comment #15) The DFmode and DImodes are different. Aligning DFmode on stack is very performance critical, while DImodes on 32bit machine can quite safely be misaligned (if we ignore their possible

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-12 Thread ubizjak at gmail dot com
--- Comment #17 from ubizjak at gmail dot com 2009-02-12 18:23 --- (In reply to comment #15) The DFmode and DImodes are different. Aligning DFmode on stack is very performance critical, while DImodes on 32bit machine can quite safely be misaligned (if we ignore their possible use in

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-12 Thread jakub at gcc dot gnu dot org
--- Comment #18 from jakub at gcc dot gnu dot org 2009-02-12 21:17 --- In that case people probably wouldn't use -mpreferred-stack-boundary=2 though... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39137

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-11 Thread ubizjak at gmail dot com
--- Comment #11 from ubizjak at gmail dot com 2009-02-11 08:42 --- (In reply to comment #9) Created an attachment (id=17279) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17279action=view) [edit] A patch to add a new -malign-double= option HJ, there were lots of problems with

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-11 Thread hjl dot tools at gmail dot com
--- Comment #12 from hjl dot tools at gmail dot com 2009-02-11 14:39 --- (In reply to comment #11) (In reply to comment #9) Created an attachment (id=17279) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17279action=view) [edit] A patch to add a new -malign-double= option

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-11 Thread pinskia at gcc dot gnu dot org
--- Comment #13 from pinskia at gcc dot gnu dot org 2009-02-11 22:11 --- Is there a reason why this is a P1? I don't see why this should be a P1. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39137

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-10 Thread hjl dot tools at gmail dot com
--- Comment #5 from hjl dot tools at gmail dot com 2009-02-10 20:32 --- Created an attachment (id=17277) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17277action=view) A patch Does this patch look OK? If yes, I will submit it with a couple of testcases. --

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-10 Thread jakub at gcc dot gnu dot org
--- Comment #6 from jakub at gcc dot gnu dot org 2009-02-10 20:48 --- This would mean -Os vs. -O2 gives different __alignof__(long long) values, I think that's a bad idea. I think a new option to disable dynamic realignment or at least do that if estimated stack size is = 64 bits would

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-10 Thread hjl dot tools at gmail dot com
--- Comment #7 from hjl dot tools at gmail dot com 2009-02-10 21:02 --- (In reply to comment #6) This would mean -Os vs. -O2 gives different __alignof__(long long) values, I think that's a bad idea. I think a new option to disable dynamic realignment or at least do that if estimated

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-10 Thread hjl dot tools at gmail dot com
--- Comment #8 from hjl dot tools at gmail dot com 2009-02-10 21:15 --- (In reply to comment #6) This would mean -Os vs. -O2 gives different __alignof__(long long) values, I __alignof__(type) isn't that useful. The alignment of double changes depending on 1. If it is on stack. 2. If

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-10 Thread hjl dot tools at gmail dot com
--- Comment #9 from hjl dot tools at gmail dot com 2009-02-10 22:29 --- Created an attachment (id=17279) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17279action=view) A patch to add a new -malign-double= option -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39137

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-10 Thread Joey dot ye at intel dot com
--- Comment #10 from Joey dot ye at intel dot com 2009-02-11 01:03 --- (In reply to comment #9) Created an attachment (id=17279) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17279action=view) [edit] A patch to add a new -malign-double= option This patch looks OK to me. --

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-09 Thread jakub at gcc dot gnu dot org
-- jakub at gcc dot gnu dot org changed: What|Removed |Added Target Milestone|--- |4.4.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39137

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-09 Thread rguenth at gcc dot gnu dot org
--- Comment #1 from rguenth at gcc dot gnu dot org 2009-02-09 14:39 --- Confirmed. I think with -Os or even more with -mpreferred-stack-boundary dynamic stack alignment should _not_ be used. -- rguenth at gcc dot gnu dot org changed: What|Removed

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-09 Thread hjl dot tools at gmail dot com
--- Comment #2 from hjl dot tools at gmail dot com 2009-02-09 14:57 --- (In reply to comment #1) Confirmed. I think with -Os or even more with -mpreferred-stack-boundary dynamic stack alignment should _not_ be used. That will cause core dump on programs with __m128/__m256. We have

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-09 Thread jakub at gcc dot gnu dot org
--- Comment #3 from jakub at gcc dot gnu dot org 2009-02-09 15:06 --- How can #1 cause a problem with -ftree-vectorize (especially when it hasn't been problem in 4.3 and earlier)? We'd do realignment for V[1248]* modes, just not for DImode/DFmode... --

[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign

2009-02-09 Thread hjl dot tools at gmail dot com
--- Comment #4 from hjl dot tools at gmail dot com 2009-02-09 15:21 --- (In reply to comment #3) How can #1 cause a problem with -ftree-vectorize (especially when it hasn't I don't believe -mpreferred-stack-boundary=2 -ftree-vectorize works well in gcc 4.3. been problem in 4.3 and