From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16041 invoked by alias); 8 Sep 2015 13:19:08 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 16020 invoked by uid 89); 8 Sep 2015 13:19:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f178.google.com Received: from mail-yk0-f178.google.com (HELO mail-yk0-f178.google.com) (209.85.160.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 08 Sep 2015 13:19:05 +0000 Received: by ykei199 with SMTP id i199so117706134yke.0 for ; Tue, 08 Sep 2015 06:19:04 -0700 (PDT) X-Received: by 10.129.107.138 with SMTP id g132mr28349615ywc.8.1441718343855; Tue, 08 Sep 2015 06:19:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.231.7 with HTTP; Tue, 8 Sep 2015 06:18:44 -0700 (PDT) In-Reply-To: <20150908131647.GA6068@x4> References: <55EEAE4A.40307@redhat.com> <20150908131647.GA6068@x4> From: Mathieu Malaterre Date: Tue, 08 Sep 2015 13:19:00 -0000 Message-ID: Subject: Re: Susprising behavior of gcc on x86 (-m32) To: Markus Trippelsdorf Cc: gcc-help Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00033.txt.bz2 On Tue, Sep 8, 2015 at 3:16 PM, Markus Trippelsdorf wrote: > On 2015.09.08 at 14:40 +0200, Mathieu Malaterre wrote: >> On Tue, Sep 8, 2015 at 2:00 PM, Mathieu Malaterre wrote: >> > FYI, >> > >> > On Tue, Sep 8, 2015 at 12:04 PM, Jonathan Wakely wrote: >> > [...] >> >> That's not the only option. You could compile one file with GCC and >> >> all others with Clang and see if you can reproduce it. Repeat for each >> >> file, which will narrow down the file where the problem occurs. Then >> >> you can try splitting that file into smaller pieces, with one function >> >> per file, and repeat the process. That would tell you which function >> >> or functions get miscompiled by GCC. >> > >> > Ok so if I compile eveything with gcc and then only `tcd.c` using >> > clang, then everything works as expected (no symptoms). >> > ref: https://github.com/uclouvain/openjpeg/blob/master/src/lib/openjp2/tcd.c >> > >> > I'll repeat your approach to find the culprit function. >> >> And the culprit function is `opj_tcd_makelayer`: >> >> https://github.com/uclouvain/openjpeg/blob/master/src/lib/openjp2/tcd.c#L218 >> >> Other than the `if (dd / dr >= thresh)` I do not see anything >> obviously suspicious. > > Looks like a x87 vs. SSE2 issue. You could try adding "-msse2 > -mfpmath=sse" for the -m32 case. Indeed that fixes the symptoms. I'll check with upstream how best to rewrite the floating point comparison. Thx for the help everyone.