From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23856 invoked by alias); 2 Aug 2011 12:43:26 -0000 Received: (qmail 23847 invoked by uid 22791); 2 Aug 2011 12:43:26 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Aug 2011 12:43:02 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/49942] Wrong code generated for -O2 with target s390 on Linux X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Tue, 02 Aug 2011 12:43:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-08/txt/msg00163.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49942 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #8 from Jakub Jelinek 2011-08-02 12:42:56 UTC --- Can't reproduce on: struct oper { char *digits; char sign; }; struct oper oper0 = {"900000000", '+'}; struct oper oper1 = {"400000000", '+'}; static int comp (struct oper *op0, struct oper *op1) { int i; __builtin_printf ("%s vs %s ", op0->digits, op1->digits); for (i = 0; 9 > i; i++) { int diff = (0xff & op0->digits[i]) - (0xff & op1->digits[i]); if (diff) return '-' == op0->sign ? (0 < diff ? -1 : 1) : (0 > diff ? -1 : 1); } return 0; } int main () { __builtin_printf (" is %d\n", comp (&oper0, &oper1)); __builtin_printf (" is %d\n", comp (&oper1, &oper0)); return 0; } With current 4.6 branch as well as trunk, compiling with with -m31 -O{0,1,2} on x86_64-linux -> s390x-linux cross, then running on s390 always results in: 900000000 vs 400000000 is 1 400000000 vs 900000000 is -1