Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 323431 - gcc-4.4.3-r2 miscompiles
Summary: gcc-4.4.3-r2 miscompiles
Status: RESOLVED DUPLICATE of bug 270120
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-10 15:02 UTC by Alexander Bezrukov
Modified: 2010-06-10 15:18 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,4.23 KB, text/plain)
2010-06-10 15:03 UTC, Alexander Bezrukov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Bezrukov 2010-06-10 15:02:36 UTC
Hello,

after upgrading to gcc-4.4.3-r2 (the latest stable) I started to suffer from random crashes. Short analysis revealed that the reason is that with -O3 (maybe with lower optimization levels, too -- it's not that easy to catch the problem, I am not sure) gcc generates aligned accesses to arguments on stack which are not necessarily aligned. Depending on the model and stepping of the CPU, this can lead to an exception. A user sees a segfault.

This is indeed what Bugs #301389 and #301819 are about.


Reproducible: Always

Steps to Reproduce:
1. CFLAGS="-march=core2 -O3 -ggdb" FEATURES="splitdebug installsources"  emerge -1 sys-libs/zlib
2. Have a look at inflate_table() in inftrees.c
3. Run firefox, it may (depending on your CPU) crash
Actual Results:  
inflate_table:
.LFB45:
        .file 1 "inftrees.c"
        .loc 1 39 0
.LVL0:
        pushl   %ebp
.LCFI0:
        .loc 1 108 0
        pxor    %xmm0, %xmm0
        .loc 1 39 0
        movl    %esp, %ebp
.LCFI1:
        pushl   %edi
.LCFI2:
        pushl   %esi
.LCFI3:
        pushl   %ebx
.LCFI4:
        call    .L101
.L101:
        popl    %ebx
        addl    $_GLOBAL_OFFSET_TABLE_+[.-.L101], %ebx
        subl    $188, %esp
.LCFI5:
        .loc 1 108 0
        movdqa  %xmm0, -56(%ebp)


Note that %ebp on the last instruction is not necessarily aligned to 16 bytes (and it is not, in my very case it is 0xbffe710c).

Expected Results:  
Another code (e.g. with movdqu) is generated.

This is not the only occurence where I have got such a crash, some other were in glib, librsvg and in libxfce4util.
Comment 1 Alexander Bezrukov 2010-06-10 15:03:28 UTC
Created attachment 234861 [details]
emerge --info
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2010-06-10 15:04:40 UTC
Duplicate of bug 270120 ?
Comment 3 Alexander Bezrukov 2010-06-10 15:18:07 UTC
Yes, I have isolated this to -ftree-vectorize.
Sorry if this bug is already known.


*** This bug has been marked as a duplicate of bug 270120 ***