[Bug fortran/80965] [7/8 Regression] ICE with class argument and -O2 optimization

2018-03-03 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80965

Paul Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from Paul Thomas  ---
I completely forgot about this one - sorry.

Fixed on 7-branch and trunk.

Thanks for the report.

Paul

[Bug fortran/80965] [7/8 Regression] ICE with class argument and -O2 optimization

2018-03-03 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80965

--- Comment #7 from Paul Thomas  ---
Author: pault
Date: Sat Mar  3 16:33:17 2018
New Revision: 258213

URL: https://gcc.gnu.org/viewcvs?rev=258213=gcc=rev
Log:
2018-03-03  Paul Thomas  

PR fortran/80965
* resolve.c (build_loc_call): Change symtree name from 'loc' to
'_loc'.

2018-03-03  Paul Thomas  

PR fortran/80965
* gfortran.dg/select_type_41.f90: New test.


Added:
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/select_type_41.f90
Modified:
branches/gcc-7-branch/gcc/fortran/ChangeLog
branches/gcc-7-branch/gcc/fortran/resolve.c
branches/gcc-7-branch/gcc/fortran/trans-expr.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug fortran/80965] [7/8 Regression] ICE with class argument and -O2 optimization

2018-03-03 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80965

--- Comment #6 from Paul Thomas  ---
Author: pault
Date: Sat Mar  3 13:34:10 2018
New Revision: 258195

URL: https://gcc.gnu.org/viewcvs?rev=258195=gcc=rev
Log:
2018-03-03  Paul Thomas  

PR fortran/80965
* resolve.c (build_loc_call): Change symtree name from 'loc' to
'_loc'.

2018-03-03  Paul Thomas  

PR fortran/80965
* gfortran.dg/select_type_41.f90: New test.


Added:
trunk/gcc/testsuite/gfortran.dg/select_type_41.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/80965] [7/8 Regression] ICE with class argument and -O2 optimization

2018-01-25 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80965

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|7.3 |7.4

--- Comment #5 from Richard Biener  ---
GCC 7.3 is being released, adjusting target milestone.

[Bug fortran/80965] [7/8 Regression] ICE with class argument and -O2 optimization

2017-08-16 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80965

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|7.2 |7.3

[Bug fortran/80965] [7/8 Regression] ICE with class argument and -O2 optimization

2017-08-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80965

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|7.2 |7.3

--- Comment #5 from Richard Biener  ---
GCC 7.2 is being released, adjusting target milestone.

[Bug fortran/80965] [7/8 Regression] ICE with class argument and -O2 optimization

2017-06-09 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80965

--- Comment #4 from Paul Thomas  ---
Created attachment 41519
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41519=edit
Patch for the bug

This appears to be a consequence of r241450, which fixed PR69834 (select type
clashes).

The fix depended on selection of the address of the selector vtable, which I
obtained using the intrinsic LOC function. In building the function call, I
used the name 'loc' for the symtree, which meant that all references to the
class object 'loc' picked up the intrinsic function. Changing the selecting
intrinsic name to '_loc' seems to fix the problem and all the select type
testcases regtest OK.

I am in the middle of working on a massive patch for PR34640 and so will come
back to this PR as soon as a I can.

Cheers

Paul

[Bug fortran/80965] [7/8 Regression] ICE with class argument and -O2 optimization

2017-06-09 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80965

Paul Thomas  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |pault at gcc dot gnu.org

--- Comment #3 from Paul Thomas  ---
(In reply to Dominique d'Humieres from comment #2)
> The change occurred between revisions r241395 (2016-10-21, compiles) and
> r241433 (2016-10-21, ICE), likely r241403 (pr69566).

Dear All,

A workaround is not to call the class object 'loc'. This is fine:
module mode3_mod
contains
  subroutine xyz(loc1)
implicit none
class(*) :: loc1
real x(6)
integer ix_use
select type (loc1)
type is (integer)
  x = 0
  print *, "is an integer"
type is (real)
  ix_use = 0
  print *, "is real"
end select
  end subroutine xyz
end module mode3_mod

I will look into the cause of this. If you attempt to use associate the
subroutine by calling it, the following message appears:
   use mode3_mod
  1
Error: DUMMY attribute conflicts with INTRINSIC attribute in ‘loc’ at (1)

The class object is being compiled as a function type pointer, void (*),
ie. as the 'loc' intrinsic.

Cheers

Paul

[Bug fortran/80965] [7/8 Regression] ICE with class argument and -O2 optimization

2017-06-03 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80965

Dominique d'Humieres  changed:

   What|Removed |Added

 CC||pault at gcc dot gnu.org

--- Comment #2 from Dominique d'Humieres  ---
The change occurred between revisions r241395 (2016-10-21, compiles) and
r241433 (2016-10-21, ICE), likely r241403 (pr69566).

[Bug fortran/80965] [7/8 Regression] ICE with class argument and -O2 optimization

2017-06-03 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80965

Dominique d'Humieres  changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|UNCONFIRMED |NEW
  Known to work||5.4.0, 6.3.0
   Keywords||ice-on-valid-code
   Last reconfirmed||2017-06-03
 Ever confirmed|0   |1
Summary|ICE with class argument and |[7/8 Regression] ICE with
   |-O2 optimization|class argument and -O2
   ||optimization
   Target Milestone|--- |7.2
  Known to fail||7.1.0, 8.0

--- Comment #1 from Dominique d'Humieres  ---
Confirmed for gcc-7 and trunk (8.0).

If the compiler is configured with --enable-checking=yes, I get

pr80965.f90:3:0:

 subroutine xyz(loc)

Error: mismatching comparison operand types
void (*) ()
integer(kind=4)
if (loc.2_2 == 177599) goto ; else goto ;
pr80965.f90:3:0: Error: mismatching comparison operand types
void (*) ()
integer(kind=4)
if (loc.3_3 == 64409183) goto ; else goto ;
pr80965.f90:3:0: internal compiler error: verify_gimple failed

pr80965.f90:3:0: internal compiler error: Abort trap: 6

without/with optimization.