Bug 56347 - [4.8 Regression] FAIL: gfortran.dg/integer_exponentiation_2.f90 -O2 execution test
Summary: [4.8 Regression] FAIL: gfortran.dg/integer_exponentiation_2.f90 -O2 executi...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: 4.8.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-15 16:37 UTC by John David Anglin
Modified: 2013-03-11 00:44 UTC (History)
0 users

See Also:
Host: hppa2.0w-hp-hpux11.11
Target: hppa2.0w-hp-hpux11.11
Build: hppa2.0w-hp-hpux11.11
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Slightly reduced testcase (622 bytes, text/plain)
2013-02-15 18:37 UTC, John David Anglin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John David Anglin 2013-02-15 16:37:46 UTC
Executing on host: /test/gnu/gcc/objdir/gcc/testsuite/gfortran/../../gfortran -B
/test/gnu/gcc/objdir/gcc/testsuite/gfortran/../../ -B/test/gnu/gcc/objdir/hppa2.
0w-hp-hpux11.11/./libgfortran/ /test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integ
er_exponentiation_2.f90  -fno-diagnostics-show-caret   -O2    -B/test/gnu/gcc/ob
jdir/hppa2.0w-hp-hpux11.11/./libgfortran/.libs -L/test/gnu/gcc/objdir/hppa2.0w-h
p-hpux11.11/./libgfortran/.libs -L/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/./l
ibgfortran/.libs -B/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/./libquadmath/.lib
s -L/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/./libquadmath/.libs -L/test/gnu/g
cc/objdir/hppa2.0w-hp-hpux11.11/./libquadmath/.libs  -lm   -o ./integer_exponent
iation_2.exe    (timeout = 300)
spawn /test/gnu/gcc/objdir/gcc/testsuite/gfortran/../../gfortran -B/test/gnu/gcc
/objdir/gcc/testsuite/gfortran/../../ -B/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.
11/./libgfortran/ /test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentia
tion_2.f90 -fno-diagnostics-show-caret -O2 -B/test/gnu/gcc/objdir/hppa2.0w-hp-hp
ux11.11/./libgfortran/.libs -L/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/./libgfortran/.libs -L/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/./libgfortran/.libs -B/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/./libquadmath/.libs -L/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/./libquadmath/.libs -L/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/./libquadmath/.libs -lm -o ./integer_exponentiation_2.exe
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:142.13:

  call gee_i(i**0_8) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:143.13:

  call gee_i(i**1_8) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:144.13:

  call gee_i(i**2_8) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:145.13:

  call gee_i(i**3_8) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:146.13:

  call gee_i(i**(-1_8)) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:147.13:

  call gee_i(i**(-2_8)) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:148.13:

  call gee_i(i**(-3_8)) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:149.13:

  call gee_i(i**huge(0_8)) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:150.13:

  call gee_i(i**(-huge(0_8))) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:151.13:

  call gee_i(i**(-huge(0_8)-1_8)) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
output is:
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:142.13:

  call gee_i(i**0_8) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:143.13:

  call gee_i(i**1_8) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:144.13:

  call gee_i(i**2_8) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:145.13:

  call gee_i(i**3_8) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:146.13:

  call gee_i(i**(-1_8)) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:147.13:

  call gee_i(i**(-2_8)) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:148.13:

  call gee_i(i**(-3_8)) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:149.13:

  call gee_i(i**huge(0_8)) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:150.13:

  call gee_i(i**(-huge(0_8))) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90:151.13:

  call gee_i(i**(-huge(0_8)-1_8)) ! { dg-warning "Type mismatch in argument" }
             1
Warning: Type mismatch in argument 'i' at (1); passed INTEGER(8) to INTEGER(4)

PASS: gfortran.dg/integer_exponentiation_2.f90  -O2   (test for warnings, line 142)
PASS: gfortran.dg/integer_exponentiation_2.f90  -O2   (test for warnings, line 143)
PASS: gfortran.dg/integer_exponentiation_2.f90  -O2   (test for warnings, line 144)
PASS: gfortran.dg/integer_exponentiation_2.f90  -O2   (test for warnings, line 145)
PASS: gfortran.dg/integer_exponentiation_2.f90  -O2   (test for warnings, line 146)
PASS: gfortran.dg/integer_exponentiation_2.f90  -O2   (test for warnings, line 147)
PASS: gfortran.dg/integer_exponentiation_2.f90  -O2   (test for warnings, line 148)
PASS: gfortran.dg/integer_exponentiation_2.f90  -O2   (test for warnings, line 149)
PASS: gfortran.dg/integer_exponentiation_2.f90  -O2   (test for warnings, line 150)
PASS: gfortran.dg/integer_exponentiation_2.f90  -O2   (test for warnings, line 151)
PASS: gfortran.dg/integer_exponentiation_2.f90  -O2  (test for excess errors)
Setting LD_LIBRARY_PATH to .:/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/./libgfortran/.libs:/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/./libgfortran/.libs:/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/./libquadmath/.libs:/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/./libquadmath/.libs:/test/gnu/gcc/objdir/gcc:.:/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/./libgfortran/.libs:/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/./libgfortran/.libs:/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/./libquadmath/.libs:/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/./libquadmath/.libs:/test/gnu/gcc/objdir/gcc
spawn [open ...]

Program aborted. Backtrace:
#0  0xC1239FEF
FAIL: gfortran.dg/integer_exponentiation_2.f90  -O2  execution test

Component is just a guess.

Test appears to fail on this test:

36        call check_equal_r (a**(-2.0), (1/a)*(1/a))
(gdb)
85          if (abs(a - b) > 1.e-5 * abs(b)) call abort
(gdb)
95          if (a /= b) call abort
(gdb)
0x00002e08 in _gfortran_abort ()
    at ../../../gcc/libgfortran/intrinsics/abort.c:32
32      {

Introduced between 195125 and 195497.
Comment 1 John David Anglin 2013-02-15 18:35:58 UTC
Wrong assembly code is here:

   0x000030f4 <run_me_+396>:    fsub,sgl fr17,fr17,fr22
   0x000030f8 <run_me_+400>:    fabs,sgl fr22,fr22
   0x000030fc <run_me_+404>:    fcmp,sgl,!< fr13R,fr22
   0x00003100 <run_me_+408>:    ftest
   0x00003104 <run_me_+412>:    b,l,n 0x37f0 <run_me_+2184>,r0

This is with a slightly reduced testcase.  Bug disappears when I tried to
reduce run_me.
Comment 2 John David Anglin 2013-02-15 18:37:58 UTC
Created attachment 29471 [details]
Slightly reduced testcase
Comment 3 John David Anglin 2013-02-15 19:07:29 UTC
In final:

(note 135 134 137 [bb 11] NOTE_INSN_BASIC_BLOCK)
(insn:TI 137 135 138 (set (reg:SF 68 %fr22 [orig:303 D.1185 ] [303])
        (minus:SF (reg:SF 58 %fr17 [orig:107 D.1185 ] [107])
            (reg:SF 58 %fr17 [orig:107 D.1185 ] [107]))) integer_exponentiation_2.f90:83 140 {subsf3}
     (nil))
(insn:TI 138 137 139 (set (reg:SF 68 %fr22 [orig:304 D.1185 ] [304])
        (abs:SF (reg:SF 68 %fr22 [orig:303 D.1185 ] [303]))) integer_exponentiation_2.f90:83 150 {abssf2}
     (nil))

In expand:

;; Generating RTL for gimple basic block 12

;; if (_131 < _143)

(insn 136 135 137 (set (reg:SF 302 [ D.1185 ])
        (mult:SF (reg:SF 104 [ D.1185 ])
            (reg:SF 200 [ D.1185 ]))) integer_exponentiation_2.f90:39 -1
     (nil))

(insn 137 136 138 (set (reg:SF 303 [ D.1185 ])
        (minus:SF (reg:SF 302 [ D.1185 ])
            (reg:SF 107 [ D.1185 ]))) integer_exponentiation_2.f90:83 -1
     (nil))

(insn 138 137 139 (set (reg:SF 304 [ D.1185 ])
        (abs:SF (reg:SF 303 [ D.1185 ]))) integer_exponentiation_2.f90:83 -1
     (nil))

The tree code is:

  _131 = _130 * 9.99999974737875163555145263671875e-6;
  ...

;;   basic block 12, loop depth 0
;;    pred:       11
  powmult_43 = _12 * powmult_177;
  _142 = powmult_43 - _17;
  _143 = ABS_EXPR <_142>;
  if (_131 < _143)
    goto <bb 3>;
  else
    goto <bb 13>;
Comment 4 John David Anglin 2013-02-15 20:07:47 UTC
> Wrong assembly code is here:
> 
>    0x000030f4 <run_me_+396>:    fsub,sgl fr17,fr17,fr22
>    0x000030f8 <run_me_+400>:    fabs,sgl fr22,fr22
>    0x000030fc <run_me_+404>:    fcmp,sgl,!< fr13R,fr22
>    0x00003100 <run_me_+408>:    ftest
>    0x00003104 <run_me_+412>:    b,l,n 0x37f0 <run_me_+2184

Actually test fails at next test:

(gdb) disass $pc-16,$pc+24
Dump of assembler code from 0x30ec to 0x3114:
   0x000030ec <run_me_+388>:    ftest
   0x000030f0 <run_me_+392>:    b,l,n 0x37f0 <run_me_+2184>,r0
   0x000030f4 <run_me_+396>:    fsub,sgl fr17,fr17,fr22
   0x000030f8 <run_me_+400>:    fabs,sgl fr22,fr22
=> 0x000030fc <run_me_+404>:    fcmp,sgl,!< fr13R,fr22
   0x00003100 <run_me_+408>:    ftest
   0x00003104 <run_me_+412>:    b,l,n 0x37f0 <run_me_+2184>,r0
   0x00003108 <run_me_+416>:    fcmp,sgl,!> fr12R,fr15
   0x0000310c <run_me_+420>:    ftest
   0x00003110 <run_me_+424>:    b,l,n 0x37f0 <run_me_+2184>,r0
End of assembler dump.
(gdb) p $fr12R
$3 = 2
(gdb) p $fr15
$4 = 9.09090886e-06

Ignore #3.
Comment 5 John David Anglin 2013-02-15 21:44:34 UTC
Floating register $fr12R is clobbered by call to powf.  Problem is similar
to PR fortran/31832.
Comment 6 John David Anglin 2013-02-18 16:29:56 UTC
Author: danglin
Date: Mon Feb 18 16:29:49 2013
New Revision: 196123

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196123
Log:
	PR target/56347
	* config/pa/pa.c (pa_conditional_register_usage): On HP-UX, mark
	registers %fr12 and %fr12R as call used.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/pa/pa.c
Comment 7 John David Anglin 2013-02-18 18:04:23 UTC
Patch to remove old work around is here:
http://gcc.gnu.org/ml/gcc-patches/2013-02/msg00854.html
Comment 8 John David Anglin 2013-02-19 14:01:51 UTC
Author: danglin
Date: Tue Feb 19 14:01:40 2013
New Revision: 196139

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196139
Log:
	PR target/56347
	* acinclude.m4 (LIBGFOR_CHECK_FOR_BROKEN_POWF): Remove check for
	broken powf.
	* configure.ac (LIBGFOR_CHECK_FOR_BROKEN_POWF): Likewise.
	* intrinsics/c99_functions.c: Likewise.
	* configure: Rebuilt.
	* config.h.in: Rebuilt.


Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/acinclude.m4
    trunk/libgfortran/config.h.in
    trunk/libgfortran/configure
    trunk/libgfortran/configure.ac
    trunk/libgfortran/intrinsics/c99_functions.c
Comment 9 John David Anglin 2013-02-19 14:08:47 UTC
Fixed.
Comment 10 John David Anglin 2013-03-11 00:44:33 UTC
Author: danglin
Date: Mon Mar 11 00:44:28 2013
New Revision: 196588

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196588
Log:
	PR target/56347
	* config/pa/pa.md (call_value): Check for calls to powf and direct to
	new call patterns that clobber %fr12.
	(call_val_powf, call_val_powf_pic, call_val_powf_64bit): New insn,
	split and postreload patterns.
	* config/pa/pa.c (pa_conditional_register_usage): Revert marking
	registers %fr12 and %fr12R as call used.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/pa/pa.c
    trunk/gcc/config/pa/pa.md