Bug 45076 - [OOP] gfortran.dg/dynamic_dispatch_6.f03 ICEs with -fprofile-use
Summary: [OOP] gfortran.dg/dynamic_dispatch_6.f03 ICEs with -fprofile-use
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.9.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-26 12:49 UTC by Zdenek Sojka
Modified: 2016-11-16 16:36 UTC (History)
3 users (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-07-29 21:19:52


Attachments
Proposed test (1.62 KB, patch)
2016-03-11 13:50 UTC, Dominique d'Humieres
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2010-07-26 12:49:21 UTC
Command line:
$ gfortran -O[0123] -fprofile-generate dynamic_dispatch_6.f03
$ rm dynamic_dispatch_6.gcda
$ ./a.out
$ gfortran -O[0123] -fprofile-use dynamic_dispatch_6.f03

Compiler output:
$ gfortran -fprofile-generate dynamic_dispatch_6.f03
$ rm dynamic_dispatch_6.gcda
$ ./a.out
$ gfortran -fprofile-use dynamic_dispatch_6.f03 
dynamic_dispatch_6.f03: In function 'MAIN__':
dynamic_dispatch_6.f03:59:0: error: invalid conversion in gimple call
struct class$field_p

struct class$field_p

D.1711 = new_periodic_5th_order (&field_creator);

dynamic_dispatch_6.f03:59:0: internal compiler error: verify_stmts failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Tested revisions:
r162456 - crash
r158095 - crash
4.5 r160526 - crash
Comment 1 Richard Biener 2010-07-26 13:56:54 UTC
struct class$field_p

struct class$field_p

looks more like a frontend issue.
Comment 2 Tobias Burnus 2011-08-23 14:14:26 UTC
With 4.7 I get instead of an ICE just the warning:

dynamic_dispatch_6.f03: In function ‘MAIN__’:
dynamic_dispatch_6.f03:66:0: note: Skipping target new_periodic_5th_order with mismatching types for icall

Cf. check_ic_target in value-prof.c. The sanity check makes sure that there is no ICE with indirect call targets. The note is printed after the following check:

   if (gimple_check_call_matching_types (call_stmt, target->decl))
     return true;

I have not checked whether that check should be true, though I somehow expect that it should be for this example.
Comment 3 janus 2013-01-10 08:43:09 UTC
(In reply to comment #2)
> With 4.7 I get instead of an ICE just the warning:

Same with curent 4.8 trunk:

dynamic_dispatch_6.f03:66:0: note: Skipping target new_periodic_5th_order with mismatching types for icall 
   u => field_creator%create()
Comment 4 janus 2013-08-20 19:52:20 UTC
(In reply to janus from comment #3)
> > With 4.7 I get instead of an ICE just the warning:
> 
> Same with curent 4.8 trunk:
> 
> dynamic_dispatch_6.f03:66:0: note: Skipping target new_periodic_5th_order
> with mismatching types for icall 
>    u => field_creator%create()

With 4.8.2 and 4.9 trunk this only happens with -O0.
Comment 5 Dominique d'Humieres 2016-02-21 17:14:11 UTC
This PR seems fixed for 4.9.3, 5.3.0, and trunk (6.0). The change occurred between revisions r201916 (2013-08-22, broken) and r202111 (2013-08-30). Could someone checks that the PR is actually fixed?
Comment 6 Dominique d'Humieres 2016-03-05 10:38:55 UTC
> This PR seems fixed for 4.9.3, 5.3.0, and trunk (6.0). The change occurred
> between revisions r201916 (2013-08-22, broken) and r202111 (2013-08-30).
> Could someone checks that the PR is actually fixed?

PING! Is anybody familiar with gov testing?
Comment 7 Dominique d'Humieres 2016-03-11 13:50:32 UTC
Created attachment 37938 [details]
Proposed test
Comment 8 dominiq 2016-03-13 09:48:56 UTC
Author: dominiq
Date: Sun Mar 13 09:48:20 2016
New Revision: 234168

URL: https://gcc.gnu.org/viewcvs?rev=234168&root=gcc&view=rev
Log:
2016-03-13  Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR fortran/45076
	gfortran.dg/prof/prof.exp: New script.
	gfortran.dg/prof/dynamic_dispatch_6.f03: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/prof/
    trunk/gcc/testsuite/gfortran.dg/prof/dynamic_dispatch_6.f03
    trunk/gcc/testsuite/gfortran.dg/prof/prof.exp
Modified:
    trunk/gcc/testsuite/ChangeLog
Comment 9 dominiq 2016-03-13 23:22:47 UTC
Author: dominiq
Date: Sun Mar 13 23:22:15 2016
New Revision: 234172

URL: https://gcc.gnu.org/viewcvs?rev=234172&root=gcc&view=rev
Log:
2016-03-13  Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR fortran/45076
	gfortran.dg/prof/prof.exp: New script.
	gfortran.dg/prof/dynamic_dispatch_6.f03: New test.


Added:
    branches/gcc-5-branch/gcc/testsuite/gfortran.dg/prof/
    branches/gcc-5-branch/gcc/testsuite/gfortran.dg/prof/dynamic_dispatch_6.f03
    branches/gcc-5-branch/gcc/testsuite/gfortran.dg/prof/prof.exp
Modified:
    branches/gcc-5-branch/gcc/testsuite/ChangeLog
Comment 10 dominiq 2016-03-14 09:22:03 UTC
Author: dominiq
Date: Mon Mar 14 09:21:32 2016
New Revision: 234178

URL: https://gcc.gnu.org/viewcvs?rev=234178&root=gcc&view=rev
Log:
2016-03-13  Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR fortran/45076
	gfortran.dg/prof/prof.exp: New script.
	gfortran.dg/prof/dynamic_dispatch_6.f03: New test.


Added:
    branches/gcc-4_9-branch/gcc/testsuite/gfortran.dg/prof/
    branches/gcc-4_9-branch/gcc/testsuite/gfortran.dg/prof/dynamic_dispatch_6.f03
    branches/gcc-4_9-branch/gcc/testsuite/gfortran.dg/prof/prof.exp
Modified:
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
Comment 11 Dominique d'Humieres 2016-03-14 09:31:42 UTC
Test committed to the trunk and the gcc 4.9 and 5 branches. Closing as FIXED.
Comment 12 Michael Meissner 2016-03-14 18:19:19 UTC
Author: meissner
Date: Mon Mar 14 18:18:45 2016
New Revision: 234188

URL: https://gcc.gnu.org/viewcvs?rev=234188&root=gcc&view=rev
Log:
[gcc]
2016-03-14  Michael Meissner  <meissner@linux.vnet.ibm.com>

	Backport from mainline
	2016-03-11  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/70131
	* config/rs6000/rs6000.md (round32<mode>2_fprs): Do not do the
	optimization if we have direct move.
	(roundu32<mode>2_fprs): Likewise.

2016-03-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	Backport from mainline
	2016-03-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR target/62281
	* config/i386/sol2.h (STACK_REALIGN_DEFAULT): Define.

2016-03-10  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>

	PR target/70168
	* config/rs6000/rs6000.c (rs6000_expand_atomic_compare_and_swap):
	Handle overlapping retval and newval.

[gcc/testsuite]
2016-03-14  Michael Meissner  <meissner@linux.vnet.ibm.com>

	Backport from mainline
	2016-03-11  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/70131
	* gcc.target/powerpc/ppc-round2.c: New test.

2016-03-14  Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR fortran/45076
	gfortran.dg/prof/prof.exp: New script.
	gfortran.dg/prof/dynamic_dispatch_6.f03: New test.


Added:
    branches/ibm/gcc-5-branch/gcc/testsuite/gcc.target/powerpc/ppc-round2.c
      - copied unchanged from r234186, branches/gcc-5-branch/gcc/testsuite/gcc.target/powerpc/ppc-round2.c
    branches/ibm/gcc-5-branch/gcc/testsuite/gfortran.dg/prof/
      - copied from r234186, branches/gcc-5-branch/gcc/testsuite/gfortran.dg/prof/
Modified:
    branches/ibm/gcc-5-branch/gcc/ChangeLog
    branches/ibm/gcc-5-branch/gcc/DATESTAMP
    branches/ibm/gcc-5-branch/gcc/config/i386/sol2.h
    branches/ibm/gcc-5-branch/gcc/config/rs6000/rs6000.c
    branches/ibm/gcc-5-branch/gcc/config/rs6000/rs6000.md
    branches/ibm/gcc-5-branch/gcc/testsuite/ChangeLog