public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/101729] New: ICE in create_tmp_var, at gimple-expr.c:482
@ 2021-08-02 18:40 gscfq@t-online.de
  2021-08-03  7:41 ` [Bug fortran/101729] " rguenth at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: gscfq@t-online.de @ 2021-08-02 18:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101729

            Bug ID: 101729
           Summary: ICE in create_tmp_var, at gimple-expr.c:482
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

A legacy feature affects versions down to at least r5, at -O2+ :


$ cat z1.f90
program p
   call g(3)
end
subroutine g(n)
   integer, intent(in) :: n
   integer :: i, k = 1
   do i = 1, n
      if ( k /= 0 ) stop 1
      call h
   end do
   print *, n, k
end
subroutine h
   call g(1, *99)
   call g(2)
   stop 2
99 stop 3
end


$ gfortran-12-20210801 -c z1.f90 -O2 -std=legacy
z1.f90:14:17:

   14 |    call g(1, *99)
      |                 1
Warning: More actual than formal arguments in procedure call at (1)
during GIMPLE pass: fnsplit
z1.f90:3:3:

    3 | end
      |   ^
internal compiler error: in create_tmp_var, at gimple-expr.c:482
0x993db6 create_tmp_var(tree_node*, char const*)
        ../../gcc/gimple-expr.c:482
0x15aa794 split_function
        ../../gcc/ipa-split.c:1643
0x15aa794 execute_split_functions
        ../../gcc/ipa-split.c:1866

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug fortran/101729] ICE in create_tmp_var, at gimple-expr.c:482
  2021-08-02 18:40 [Bug fortran/101729] New: ICE in create_tmp_var, at gimple-expr.c:482 gscfq@t-online.de
@ 2021-08-03  7:41 ` rguenth at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-08-03  7:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101729

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-08-03

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
The odd thing is that 'g' has a DECL_RESULT of void type but the function type
of 'g' has a return type of integer(kind=4) ...

 <function_decl 0x7ffff6717200 g
    type <function_type 0x7ffff6718b28
        type <integer_type 0x7ffff65585e8 integer(kind=4) public SI
            size <integer_cst 0x7ffff6543df8 constant 32>
            unit-size <integer_cst 0x7ffff6543e10 constant 4>
            align:32 warn_if_not_align:0 symtab:0 alias-set 1 canonical-type
0x7ffff65585e8 precision:32 min <integer_cst 0x7ffff6543db0 -2147483648> max
<integer_cst 0x7ffff6543dc8 2147483647>
            pointer_to_this <pointer_type 0x7ffff655f9d8> reference_to_this
<reference_type 0x7ffff67180a8>>
        QI
        size <integer_cst 0x7ffff6543ca8 constant 8>
        unit-size <integer_cst 0x7ffff6543cc0 constant 1>
        align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff6718b28
        arg-types <tree_list 0x7ffff6715d48 value <reference_type
0x7ffff6718150>
            chain <tree_list 0x7ffff6557b18 value <void_type 0x7ffff6558f18
void>>>
        pointer_to_this <pointer_type 0x7ffff6718bd0>>
    addressable used nothrow public static QI t.f90:4:12 align:8
warn_if_not_align:0 context <translation_unit_decl 0x7ffff654e168 t.f90>
initial <block 0x7ffff671c120>
    result <result_decl 0x7ffff654e1e0 D.3929
        type <void_type 0x7ffff6558f18 void VOID
            align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff6558f18
            pointer_to_this <pointer_type 0x7ffff655f000>>


ipa-split does

          if (split_point->split_part_set_retval
              && !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (current_function_decl))))
            {
              retval = DECL_RESULT (current_function_decl);

              /* We use temporary register to hold value when aggregate_value_p
                 is false.  Similarly for DECL_BY_REFERENCE we must avoid extra
                 copy.  */
              if (!aggregate_value_p (retval, TREE_TYPE
(current_function_decl))
                  && !DECL_BY_REFERENCE (retval))
                retval = create_tmp_reg (TREE_TYPE (retval));

interestingly when fixing the bogus call g(1, *99) then the return type
of the function is void as expected.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-03  7:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-02 18:40 [Bug fortran/101729] New: ICE in create_tmp_var, at gimple-expr.c:482 gscfq@t-online.de
2021-08-03  7:41 ` [Bug fortran/101729] " rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).