[regression] mpfr tasinh test doesn't terminate when built with Linaro GCC 4.8 on armhf

Bug #1232017 reported by Matthias Klose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GCC
Fix Released
Undecided
Kugan Vivekanandarajah
gcc
Fix Released
Medium
gcc-4.8 (Ubuntu)
Fix Released
High
Unassigned
Saucy
Fix Released
High
Unassigned
gmp (Ubuntu)
Invalid
High
Unassigned
Saucy
Invalid
High
Unassigned
mpfr4 (Ubuntu)
Fix Released
High
Unassigned
Saucy
Fix Released
High
Unassigned

Bug Description

mpfr tasinh test doesn't terminate when built with Linaro GCC 4.8 on armhf. seen with -O1 and up. works with -O0

Tags: ftbfs
Matthias Klose (doko)
Changed in gcc-4.8 (Ubuntu Saucy):
milestone: none → ubuntu-13.10
Changed in mpfr4 (Ubuntu Saucy):
status: New → Confirmed
importance: Undecided → High
milestone: none → ubuntu-13.10
Revision history for this message
Matthias Klose (doko) wrote :

the gmp testsuite also succeeds when gmp is built with -O0.

Changed in gmp (Ubuntu Saucy):
importance: Undecided → High
milestone: none → ubuntu-13.10
status: New → Confirmed
Changed in gcc-linaro:
assignee: nobody → Kugan Vivekanandarajah (kugan-vivekanandarajah)
Revision history for this message
Kugan Vivekanandarajah (kugan-vivekanandarajah) wrote :

Bad code is generated for mpfr_impl.h compare at line 1430. Due to this,
mpfr_asinh is producing wrong values for some inputs.

Original testcase involves random values so created a reduced case. With
the test case attached, even though _err1 is -38, "if condition" is
evaluated true. Following is the disassembly. Working is -O1
-fno-if-conversion. and Not working is -O1.

/* C Code */
    if (_err1 > 0)
      {

/* working code */
 cmp r3, #0
 ble .L6

/* not working code*/
 .loc 1 67 0
 movs r3, r3, asl #1

The patch which is causing this regression seems to be
http://gcc.gnu.org/ml/gcc-patches/2013-02/msg00861.html

Revision history for this message
Kugan Vivekanandarajah (kugan-vivekanandarajah) wrote :
Revision history for this message
In , Kuganv (kuganv) wrote :

Created attachment 30936
preprocessed testcase

mpfr tasinh 3.1.1. does not produce correct code for optimization level -O1 and above. Preprocessed ouput for a reduced testcase is attached. For the reduced testcase, if-condition at line 45 (original source) is evaluated true whereas it is not when compiled with -O1 and run. This can be easily verified with gdb.

gcc version 4.9.0 20130922 (experimental)

Revision history for this message
Kugan Vivekanandarajah (kugan-vivekanandarajah) wrote :

Created a bug upstream with a reduced testcase
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58578

Changed in gcc:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
In , Rearnsha (rearnsha) wrote :

Please can you add the output of gcc -v that was used when compiling this test.

Revision history for this message
In , Rearnsha (rearnsha) wrote :

I suspect this was introduced with r197527

Revision history for this message
In , Kuganv (kuganv) wrote :

gcc -v
Using built-in specs.
COLLECT_GCC=/home/kugan/work/install-trunk/bin/gcc
COLLECT_LTO_WRAPPER=/home/kugan/work/install-trunk/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.9.0/lto-wrapper
Target: armv7l-unknown-linux-gnueabihf
Configured with: ../trunk/configure --target=armv7l-unknown-linux-gnueabihf --host=armv7l-unknown-linux-gnueabihf --build=armv7l-unknown-linux-gnueabihf --prefix=/home/kugan/work/install-trunk --with-float=hard --enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.9.0 20130922 (experimental) (GCC)

Revision history for this message
In , Clyon (clyon) wrote :

Author: clyon
Date: Tue Oct 1 13:19:31 2013
New Revision: 203059

URL: http://gcc.gnu.org/viewcvs?rev=203059&root=gcc&view=rev
Log:
2013-10-01 Kugan Vivekanandarajah <email address hidden>

 gcc/
 PR target/58578
 Revert
 2013-04-05 Greta Yorsh <email address hidden>
 * config/arm/arm.md (arm_ashldi3_1bit): define_insn into
 define_insn_and_split.
 (arm_ashrdi3_1bit,arm_lshrdi3_1bit): Likewise.
 (shiftsi3_compare): New pattern.
 (rrx): New pattern.
 * config/arm/unspecs.md (UNSPEC_RRX): New.

 gcc/testsuite
 PR target/58578
 * gcc.target/arm/pr58578.c: New test.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/arm/arm.md
    trunk/gcc/config/arm/unspecs.md
    trunk/gcc/testsuite/ChangeLog

Revision history for this message
In , Rearnsha (rearnsha) wrote :

Faulty patch reverted.

Revision history for this message
Matthias Klose (doko) wrote :

mpfr is now built in saucy

Changed in mpfr4 (Ubuntu Saucy):
status: Confirmed → Fix Released
Revision history for this message
Matthias Klose (doko) wrote :

tracking the gmp failure in lp: #1234060

Changed in gmp (Ubuntu Saucy):
status: Confirmed → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-4.8 - 4.8.1-10ubuntu5

---------------
gcc-4.8 (4.8.1-10ubuntu5) saucy; urgency=low

  * Update to SVN 20131001 (r203063) from the gcc-4_8-branch.
    - Fix PR libstdc++/58437, PR middle-end/58463, PR tree-optimization/56716,
      PR middle-end/58564, PR target/58574 (s390).
    - Go updates.
  * Fix PR target/58578, wrong-code regression on ARM. LP: #1232017.
 -- Matthias Klose <email address hidden> Tue, 01 Oct 2013 18:48:31 +0200

Changed in gcc-4.8 (Ubuntu Saucy):
status: Confirmed → Fix Released
Revision history for this message
In , Clyon (clyon) wrote :

Author: clyon
Date: Wed Oct 2 14:07:45 2013
New Revision: 203116

URL: http://gcc.gnu.org/viewcvs?rev=203116&root=gcc&view=rev
Log:
Add forgotten test case for r203059.

2013-10-01 Kugan Vivekanandarajah <email address hidden>

        gcc/testsuite
        PR target/58578
        * gcc.target/arm/pr58578.c: New test.

Added:
    trunk/gcc/testsuite/gcc.target/arm/pr58578.c

Changed in gcc:
status: New → Fix Released
Revision history for this message
In , Clyon (clyon) wrote :

Author: clyon
Date: Wed Oct 2 22:12:37 2013
New Revision: 203137

URL: http://gcc.gnu.org/viewcvs?rev=203137&root=gcc&view=rev
Log:
2013-10-01 Kugan Vivekanandarajah <email address hidden>

 Backport from trunk r203059,203116.
 2013-10-01 Kugan Vivekanandarajah <email address hidden>

 PR target/58578
 Revert
 2013-04-05 Greta Yorsh <email address hidden>
 * config/arm/arm.md (arm_ashldi3_1bit): define_insn into
 define_insn_and_split.
 (arm_ashrdi3_1bit,arm_lshrdi3_1bit): Likewise.
 (shiftsi3_compare): New pattern.
 (rrx): New pattern.
 * config/arm/unspecs.md (UNSPEC_RRX): New.

2013-10-01 Kugan Vivekanandarajah <email address hidden>

 Backport from trunk r203059,203116.
 2013-10-01 Kugan Vivekanandarajah <email address hidden>

 PR Target/58578
 * gcc.target/arm/pr58578.c: New test.

Modified:
    branches/linaro/gcc-4_8-branch/gcc/ChangeLog.linaro
    branches/linaro/gcc-4_8-branch/gcc/config/arm/arm.md
    branches/linaro/gcc-4_8-branch/gcc/config/arm/unspecs.md
    branches/linaro/gcc-4_8-branch/gcc/testsuite/ChangeLog.linaro

Revision history for this message
Christophe Lyon (christophe-lyon) wrote :

Fixed in linaro-4.8 branch as 203137,203138.

Changed in gcc-linaro:
status: New → Fix Committed
Viktor (vchong)
Changed in gcc-linaro:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.