From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26812 invoked by alias); 3 Dec 2010 15:27:23 -0000 Received: (qmail 26801 invoked by uid 22791); 3 Dec 2010 15:27:23 -0000 X-SWARE-Spam-Status: No, hits=-2.8 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; Fri, 03 Dec 2010 15:27:18 +0000 From: "amonakov at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/46758] [4.5/4.6 Regression] -fgraphite-identity produces wrong code when using 64bit constants X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: amonakov at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.5.2 X-Bugzilla-Changed-Fields: Status Last reconfirmed CC Ever Confirmed 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: Fri, 03 Dec 2010 15:27: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: 2010-12/txt/msg00315.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46758 Alexander Monakov changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2010.12.03 15:27:13 CC| |amonakov at gcc dot gnu.org Ever Confirmed|0 |1 --- Comment #1 from Alexander Monakov 2010-12-03 15:27:13 UTC --- In this particular example, the problem is in scan_tree_for_params_int: int v = int_cst_value (cst); mpz_init (val); mpz_set_si (val, 0); /* Necessary to not get "-1 = 2^n - 1". */ if (v < 0) mpz_sub_ui (val, val, -v); else mpz_add_ui (val, val, v); (gdb) p cst $8 = (tree) 0x7ffff5a4e848 (gdb) pt constant -8589934593> (gdb) p v $9 = -1 (gdb) There are multiple places where graphite uses int_cst_value. Note that the problem may be more severe on 32-bit hosts as there the tree may hold a 64-bit constant but mpz_*_{u,s}i accepts 'long's.