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: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-26 12:49 UTC by Zdenek Sojka
Modified: 2013-08-20 19:52 UTC (History)
2 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

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.