This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR target/40838: gcc shouldn't assume that the stack is aligned


On Sat, 12 Sep 2009, H.J. Lu wrote:

> 2009/9/12 Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>:
> >
> > I tried this patch for 4.4.1 (that one posted in bugzilla 40838) with
> > seamonkey 1.1.17 and it relly misses alignment in some parts of it. I used
> > CFLAGS and CXXFLAGS "-O3 -fomit-frame-pointer -frename-registers
> > -march=barcelona"
> >
> > I found the functions that miscompile, the trivial way to find them is to
> > compile seamonkey, do find . -name "*.o"|xargs objdump -d|less, search for
> > "movdqa.*esp" or "movaps.*esp" (or even "esp.*xmm" and "xmm.*esp", but it
> > gives more false positives) and check the function that it has aligment
> > code. There are a few functions that don't. Please look at these
> > functions, the idea of your patch is good, it just needs to be fixed.
> >
> > BTW. gentoo documentation lists -O3 as problematic flag that leads to
> > instability with gcc 4 (they don't way why, but the most likely reason is
> > this alignment issue), it would be good if we could fix it and allow
> > people to use SSE.
> >
> 
> Please find a small testcase and upload it to PR 40838.
> 
> Thank.s
> 
> Thanks.

OK. The misgenerated examples were similar to one of the two issues, so I 
posted two examples for them to bugzilla. So you can find the bug in your 
patch.

There is another bug: The compiler shouldn't assume that arrays in the 
common section are aligned. They may be initialized in a different module 
compiled with different compiler that doesn't do alignment.

Mikulas


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]