This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/52386] [4.6/4.7 Regression] ICE in gfc_conv_descriptor_dtyp (realloc LHS related)
- 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: Sun, 26 Feb 2012 11:17:39 +0000
- Subject: [Bug fortran/52386] [4.6/4.7 Regression] ICE in gfc_conv_descriptor_dtyp (realloc LHS related)
- Auto-submitted: auto-generated
- References: <bug-52386-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52386
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
CC| |burnus at gcc dot gnu.org,
| |pault at gcc dot gnu.org
Target Milestone|--- |4.6.3
Summary|ICE in |[4.6/4.7 Regression] ICE in
|gfc_conv_descriptor_dtyp |gfc_conv_descriptor_dtyp
| |(realloc LHS related)
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-26 11:17:39 UTC ---
Work around: -fno-realloc-lhs.
I tried the following as one has a NOP expr, but I think one needs more. After
removing the nop, one still has:
(gdb) p debug_tree (desc)
<parm_decl 0x2aaaacbed5d8 __result
type <reference_type 0x2aaaacd10348
type <record_type 0x2aaaacd0dc78 array1_integer(kind=4) type_1 BLK
size <integer_cst 0x2aaaacd06180 constant 384>
unit size <integer_cst 0x2aaaacce7c00 constant 48>
align 64 symtab 0 alias set -1 canonical type 0x2aaaacd0dd20 fields
<field_decl 0x2aaaacd05390 data>
pointer_to_this <pointer_type 0x2aaaacd10150> reference_to_this
<reference_type 0x2aaaacd10348> chain <type_decl 0x2aaaacc10a10 D.1859>>
unsigned DI
size <integer_cst 0x2aaaacbe5ec0 constant 64>
unit size <integer_cst 0x2aaaacbe5ee0 constant 8>
align 64 symtab 0 alias set -1 canonical type 0x2aaaacd103f0>
readonly used unsigned DI file hj4faf.f90 line 5 col 0 size <integer_cst
0x2aaaacbe5ec0 64> unit size <integer_cst 0x2aaaacbe5ee0 8>
align 64 context <function_decl 0x2aaaacd0e300 reduced> arg-type
<reference_type 0x2aaaacd10348> chain <parm_decl 0x2aaaacbed660 array>>
--- trans-expr.c (Revision 184582)
+++ trans-expr.c
@@ -6299,6 +6301,7 @@ fcncall_realloc_result (gfc_se *se, int rank)
/* Use the allocation done by the library. Substitute the lhs
descriptor with a copy, whose data field is nulled.*/
desc = build_fold_indirect_ref_loc (input_location, se->expr);
+ STRIP_NOPS (desc);
/* Unallocated, the descriptor does not have a dtype. */
tmp = gfc_conv_descriptor_dtype (desc);