Dominique Pelle wrote:
> 2008/11/15 Tony Mechelynck <[EMAIL PROTECTED]>: > > > On 15/11/08 11:12, Dominique Pelle wrote: > >> Hi > >> > >> I notice that Vim-7.2.40 (huge) crashes on start up when I > >> compile it with gcc 4.3.2 with -O3 (that's the default gcc > >> version from Ubuntu-8.10), but it works perfectly fine when > >> compiled with -O0, -O1 or -O2. > > [...] > > > > -O3 is a nondefault setting in Vim, isn't it? I didn't make any changes > > to how the Vim configure and make optimizes its compile, and I end up > > (for a Huge Gnome2 GUI, but also for a Tiny Console-only build) with -O2 > > -fno-strength-reduce -Wall > > > > "gcc --version" answers: > > gcc (SUSE Linux) 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision > > 135036] > > > > followed by a copyright notice and liability disclaimer. > > > > > > Best regards, > > Tony. > > > When I said "this is the default", I meant gcc-4.3.2 is the > default compiler of Ubuntu-8.10. I did not mean that -O3 > is the default optimization level when compiling Vim. > Maybe that was confusing. > > In any case, I would expect -O3 to work. One of the most > important optimization brought by -O3 is inlining of functions. > And this is precisely the optimization which somehow breaks vim. > > You can build with -O3 by editing src/makefile, or by doing... > > make CFLAGS=-O3 > > Doing a google search, I found afterwards that it's not a new > issue. It was already reported here with the same suggested > fix: > > http://www.mail-archive.com/[EMAIL PROTECTED]/msg03320.html > > However, the above thread mentions that -fstack-protector triggers > it, whereas I observe it with -O3 or with -O2 -g -finline-functions. Apparently -fstack-protector is on by default. The "inline-functions" apparently does something to reveal the size of the destination to strcpy(). That's a bit unexpected though. Why not compile Vim with -fno-stack-protector ? Can you try with -O3 and that flag? It's not clear to me that this stack-protector function is what actually adds the check for the array size. -- Two fish in a tank. One says to the other: "Do you know how to drive this thing?" /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---