public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/62098] New: incorrect code generated by arm  gcc
@ 2014-08-11 20:56 carrot at google dot com
  2014-08-12 12:19 ` [Bug target/62098] [4.9 regression] " ramana at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: carrot at google dot com @ 2014-08-11 20:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62098

            Bug ID: 62098
           Summary: incorrect code generated by arm  gcc
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: carrot at google dot com
            Target: arm-unknown-linux-gnueabi

Compile following source code with options -march=armv7-a  -mfpu=vfpv3
-mfloat-abi=softfp -O2 -std=gnu++11

#include <limits>
#include <cmath>

const int kFixedPointDenominator = 64;

float ceilToFloat(int m_value)  {
  float floatValue = static_cast<float>(m_value) / kFixedPointDenominator;
  if (static_cast<int>(floatValue * kFixedPointDenominator) == m_value)
     return floatValue;
  if (floatValue > 0)
     return nextafterf(floatValue, std::numeric_limits<float>::max());
  return nextafterf(floatValue, std::numeric_limits<float>::min());
}


trunk gcc generates:

    fmsr    s15, r0    @ int
    vcvt.f32.s32    s15, s15, #6          // A
    vcvt.s32.f32    s15, s15, #6          // B
    vmov    r3, s15
    cmp    r3, r0
    beq    .L2
    fcmpezs    s15
    fmstat
    ble    .L6
    movw    r1, #65535
    fmrs    r0, s15
    movt    r1, 32639
    b    nextafterf
.L6:
    mov    r1, #8388608
    fmrs    r0, s15
    b    nextafterf
.L2:
    fmrs    r0, s15                       // C
    bx    lr


Instruction C returns the result of instruction B, but the expected return
value is the result of instruction A.

4.9 branch generates the same wrong codes, but 4.8 is correct.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/62098] [4.9 regression] incorrect code generated by arm  gcc
  2014-08-11 20:56 [Bug target/62098] New: incorrect code generated by arm gcc carrot at google dot com
@ 2014-08-12 12:19 ` ramana at gcc dot gnu.org
  2014-08-12 12:37 ` [Bug target/62098] [4.9/4.10 " ramana at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ramana at gcc dot gnu.org @ 2014-08-12 12:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62098

Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-08-12
   Target Milestone|---                         |4.9.2
            Summary|[4.9 regressionincorrect    |[4.9 regression] incorrect
                   |code generated by arm  gcc  |code generated by arm  gcc
     Ever confirmed|0                           |1

--- Comment #1 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> ---
Bummer, uggh the vcvtf2i pattern is wrong.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/62098] [4.9/4.10 regression] incorrect code generated by arm  gcc
  2014-08-11 20:56 [Bug target/62098] New: incorrect code generated by arm gcc carrot at google dot com
  2014-08-12 12:19 ` [Bug target/62098] [4.9 regression] " ramana at gcc dot gnu.org
@ 2014-08-12 12:37 ` ramana at gcc dot gnu.org
  2014-08-12 13:03 ` ramana at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ramana at gcc dot gnu.org @ 2014-08-12 12:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62098

Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |ramana at gcc dot gnu.org


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/62098] [4.9/4.10 regression] incorrect code generated by arm  gcc
  2014-08-11 20:56 [Bug target/62098] New: incorrect code generated by arm gcc carrot at google dot com
  2014-08-12 12:19 ` [Bug target/62098] [4.9 regression] " ramana at gcc dot gnu.org
  2014-08-12 12:37 ` [Bug target/62098] [4.9/4.10 " ramana at gcc dot gnu.org
@ 2014-08-12 13:03 ` ramana at gcc dot gnu.org
  2014-08-12 14:32 ` ramana at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ramana at gcc dot gnu.org @ 2014-08-12 13:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62098

--- Comment #2 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> ---
Created attachment 33300
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33300&action=edit
Patch under testing.

Embarassing patch to fix the issue. Currently being tested .


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/62098] [4.9/4.10 regression] incorrect code generated by arm  gcc
  2014-08-11 20:56 [Bug target/62098] New: incorrect code generated by arm gcc carrot at google dot com
                   ` (2 preceding siblings ...)
  2014-08-12 13:03 ` ramana at gcc dot gnu.org
@ 2014-08-12 14:32 ` ramana at gcc dot gnu.org
  2014-08-20 11:31 ` [Bug target/62098] [4.9/5 " ramana at gcc dot gnu.org
  2014-08-20 11:53 ` ramana at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: ramana at gcc dot gnu.org @ 2014-08-12 14:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62098

--- Comment #3 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> ---
Author: ramana
Date: Tue Aug 12 14:32:07 2014
New Revision: 213861

URL: https://gcc.gnu.org/viewcvs?rev=213861&root=gcc&view=rev
Log:
Fix PR target/62098

2014-08-12  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

    PR target/62098
    * config/arm/vfp.md (*combine_vcvtf2i): Fix constraint.
    Remove unnecessary attributes.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/arm/vfp.md


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/62098] [4.9/5 regression] incorrect code generated by arm  gcc
  2014-08-11 20:56 [Bug target/62098] New: incorrect code generated by arm gcc carrot at google dot com
                   ` (3 preceding siblings ...)
  2014-08-12 14:32 ` ramana at gcc dot gnu.org
@ 2014-08-20 11:31 ` ramana at gcc dot gnu.org
  2014-08-20 11:53 ` ramana at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: ramana at gcc dot gnu.org @ 2014-08-20 11:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62098

--- Comment #4 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> ---
Author: ramana
Date: Wed Aug 20 11:31:21 2014
New Revision: 214217

URL: https://gcc.gnu.org/viewcvs?rev=214217&root=gcc&view=rev
Log:
Backport fix for PR target/62098

2014-08-20  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

    Backport from mainline.
    2014-08-12  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
    PR target/62098
    * config/arm/vfp.md (*combine_vcvtf2i): Fix constraint.
    Remove unnecessary attributes.



Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/config/arm/vfp.md


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/62098] [4.9/5 regression] incorrect code generated by arm  gcc
  2014-08-11 20:56 [Bug target/62098] New: incorrect code generated by arm gcc carrot at google dot com
                   ` (4 preceding siblings ...)
  2014-08-20 11:31 ` [Bug target/62098] [4.9/5 " ramana at gcc dot gnu.org
@ 2014-08-20 11:53 ` ramana at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: ramana at gcc dot gnu.org @ 2014-08-20 11:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62098

Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
      Known to fail|4.10.0                      |5.0

--- Comment #5 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> ---
Fixed now.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-08-20 11:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-11 20:56 [Bug target/62098] New: incorrect code generated by arm gcc carrot at google dot com
2014-08-12 12:19 ` [Bug target/62098] [4.9 regression] " ramana at gcc dot gnu.org
2014-08-12 12:37 ` [Bug target/62098] [4.9/4.10 " ramana at gcc dot gnu.org
2014-08-12 13:03 ` ramana at gcc dot gnu.org
2014-08-12 14:32 ` ramana at gcc dot gnu.org
2014-08-20 11:31 ` [Bug target/62098] [4.9/5 " ramana at gcc dot gnu.org
2014-08-20 11:53 ` ramana at gcc dot gnu.org

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).