Bug 37668 - Obvious bug in arm.c: arm_size_rtx_costs() case NEG:
Summary: Obvious bug in arm.c: arm_size_rtx_costs() case NEG:
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.3.2
: P3 minor
Target Milestone: 4.4.0
Assignee: Richard Earnshaw
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-28 09:54 UTC by Martin Guy
Modified: 2008-12-10 15:00 UTC (History)
2 users (show)

See Also:
Host:
Target: arm-*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-12-10 14:29:42


Attachments
Aplies the "obvious" fix (260 bytes, patch)
2008-09-28 09:55 UTC, Martin Guy
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Guy 2008-09-28 09:54:13 UTC
Hi
  I spotted this while trawling through the arm code generator: the code in the NEG case has no effect. I assume the NEG case should return if the condition matches; patch attached. It's still present in trunk.

    case NEG:
      if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT)
        *total = COSTS_N_INSNS (1);
      /* Fall through */
    case NOT:
      *total = COSTS_N_INSNS (ARM_NUM_REGS (mode));
      return false;
Comment 1 Martin Guy 2008-09-28 09:55:13 UTC
Created attachment 16418 [details]
Aplies the "obvious" fix
Comment 2 Steven Bosscher 2008-09-28 11:57:07 UTC
Don't know if the patch is OK, but the code is obviously doing something silly.  CC-ing ARM maintainer.
Comment 3 Richard Earnshaw 2008-12-10 14:58:42 UTC
Subject: Bug 37668

Author: rearnsha
Date: Wed Dec 10 14:57:18 2008
New Revision: 142647

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142647
Log:
Martin Guy <martinwguy@yahoo.it>
PR target/37668
* arm.c (arm_size_rtx_costs, case NEG): Don't fall through if the
result will be in an FPU register.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/arm/arm.c

Comment 4 Richard Earnshaw 2008-12-10 15:00:04 UTC
Fixed in 4.4.0