This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/50718] [4.6/4.7 Regression] ICE (fold_convert) with -fcheck=pointer
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 13 Oct 2011 18:36:44 +0000
- Subject: [Bug fortran/50718] [4.6/4.7 Regression] ICE (fold_convert) with -fcheck=pointer
- Auto-submitted: auto-generated
- References: <bug-50718-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50718
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.6.2
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-10-13 18:36:44 UTC ---
The backtrace above is bogus. The actual issue is at gfc_conv_procedure_call
for:
cond = fold_build2_loc (input_location, EQ_EXPR,
boolean_type_node, parmse.expr,
fold_convert (TREE_TYPE (parmse.expr),
null_pointer_node));
The problem is that the formal argument uses VALUE. Hence, the actual argument
is passed by value and it not an address expression.
Hence, the test "if (*actual == NULL)" does not make sense - one would need to
use "if (actual == NULL)" - hence, the "*" needs to be stripped away before
the comparison.
Simplified test case:
type t
integer :: p
end type t
interface
subroutine sub (x)
import t
type(t), value :: x
end subroutine
end interface
type(t), pointer :: y
call sub(y)
end