public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "danglin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 Date: Wed, 01 Aug 2012 18:44:00 -0000 [thread overview] Message-ID: <bug-53823-4-xoCe6WXUDr@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-53823-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823 --- Comment #21 from John David Anglin <danglin at gcc dot gnu.org> 2012-08-01 18:44:04 UTC --- The issue is with the handling of negative constants. In this bit of code, max_cost = (set_src_cost (gen_rtx_MULT (mode, fake_reg, op1), speed) - neg_cost(speed, mode)); if (max_cost > 0 && choose_mult_variant (mode, -coeff, &algorithm, &variant, max_cost)) max_cost is computed to be 24 and choose_mult_variant returns 0. This causes the following hunk to be executed: max_cost = set_src_cost (gen_rtx_MULT (mode, fake_reg, op1), speed); if (choose_mult_variant (mode, coeff, &algorithm, &variant, max_cost)) return expand_mult_const (mode, op0, coeff, target, &algorithm, variant); max_cost is now 32 and choose_mult_variant succeeds. However, expand_mult_const generates incorrect code when coeff is negative. I hacked the max_cost in the negative case to be 32, and this produces the correct result and code similar to your cross-compiled output. If I remember correctly, the xmpyu instruction was introduced in PA 1.1 and this results in different costs for PA 1.0 and 1.1.
next prev parent reply other threads:[~2012-08-01 18:44 UTC|newest] Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-06-30 19:19 [Bug middle-end/53823] New: " danglin at gcc dot gnu.org 2012-07-02 8:52 ` [Bug middle-end/53823] " rguenth at gcc dot gnu.org 2012-07-11 10:51 ` danglin at gcc dot gnu.org 2012-07-12 1:43 ` danglin at gcc dot gnu.org 2012-07-27 18:20 ` danglin at gcc dot gnu.org 2012-07-29 16:31 ` danglin at gcc dot gnu.org 2012-07-30 13:31 ` rth at gcc dot gnu.org 2012-07-30 14:13 ` steven at gcc dot gnu.org 2012-07-30 14:26 ` ubizjak at gmail dot com 2012-07-30 15:46 ` danglin at gcc dot gnu.org 2012-07-31 18:51 ` danglin at gcc dot gnu.org 2012-07-31 19:41 ` danglin at gcc dot gnu.org 2012-07-31 19:59 ` rth at gcc dot gnu.org 2012-07-31 20:11 ` dave.anglin at bell dot net 2012-07-31 21:30 ` rth at gcc dot gnu.org 2012-07-31 22:55 ` dave.anglin at bell dot net 2012-07-31 22:56 ` dave.anglin at bell dot net 2012-08-01 0:31 ` danglin at gcc dot gnu.org 2012-08-01 0:41 ` danglin at gcc dot gnu.org 2012-08-01 2:25 ` rth at gcc dot gnu.org 2012-08-01 14:21 ` dave.anglin at bell dot net 2012-08-01 14:27 ` dave.anglin at bell dot net 2012-08-01 18:44 ` danglin at gcc dot gnu.org [this message] 2012-08-12 14:30 ` danglin at gcc dot gnu.org 2012-08-13 15:51 ` rth at gcc dot gnu.org 2012-08-18 23:17 ` danglin at gcc dot gnu.org 2012-08-18 23:33 ` danglin at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-53823-4-xoCe6WXUDr@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).