From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92521 invoked by alias); 25 Apr 2015 16:29:45 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 92235 invoked by uid 48); 25 Apr 2015 16:29:41 -0000 From: "abensonca at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/65889] New: ICE on invalid(?) with sizeof polymorphic variable [OOP] Date: Sat, 25 Apr 2015 16:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: abensonca at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg02184.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D65889 Bug ID: 65889 Summary: ICE on invalid(?) with sizeof polymorphic variable [OOP] Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: abensonca at gmail dot com The following testcase causes an ICE with gfortran 6.0 (r222432): module m type n end type n contains subroutine g(ns) class(n), intent(out), allocatable, dimension(:) :: ns write (0,*) sizeof(ns) end subroutine g end module m $ gfortran -v Using built-in specs. COLLECT_GCC=3Dgfortran COLLECT_LTO_WRAPPER=3D/nfs/17/cond0061/Galacticus/Tools/libexec/gcc/x86_64-= unknown-linux-gnu/6.0.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-trunk/configure --prefix=3D/nfs/17/cond0061/Galacticus/Tools --enable-languages=3Dc,c++,for= tran --disable-multilib Thread model: posix gcc version 6.0.0 20150424 (experimental) (GCC) $ gfortran -c small.f90 -o small.o=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20 small.f90:7:0: write (0,*) sizeof(ns) 1 internal compiler error: tree check: expected tree that contains =E2=80=98d= ecl common=E2=80=99 structure, have =E2=80=98indirect_ref=E2=80=99 in gfc_conv_intrinsic_sizeof= , at fortran/trans-intrinsic.c:5928 0xdd8994 tree_contains_struct_check_failed(tree_node const*, tree_node_structure_enum, char const*, int, char const*) ../../gcc-trunk/gcc/tree.c:9471 0x706628 contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*) ../../gcc-trunk/gcc/tree.h:2960 0x706628 gfc_conv_intrinsic_sizeof ../../gcc-trunk/gcc/fortran/trans-intrinsic.c:5928 0x70e24f gfc_conv_intrinsic_function(gfc_se*, gfc_expr*) ../../gcc-trunk/gcc/fortran/trans-intrinsic.c:8185 0x6ece32 gfc_conv_expr(gfc_se*, gfc_expr*) ../../gcc-trunk/gcc/fortran/trans-expr.c:7361 0x6f3685 gfc_conv_expr_reference(gfc_se*, gfc_expr*) ../../gcc-trunk/gcc/fortran/trans-expr.c:7496 0x7150c1 gfc_trans_transfer(gfc_code*) ../../gcc-trunk/gcc/fortran/trans-io.c:2394 0x6b18d7 trans_code ../../gcc-trunk/gcc/fortran/trans.c:1885 0x7121b0 build_dt ../../gcc-trunk/gcc/fortran/trans-io.c:1921 0x6b18f7 trans_code ../../gcc-trunk/gcc/fortran/trans.c:1857 0x6de1df gfc_generate_function_code(gfc_namespace*) ../../gcc-trunk/gcc/fortran/trans-decl.c:5896 0x6b6149 gfc_generate_module_code(gfc_namespace*) ../../gcc-trunk/gcc/fortran/trans.c:2053 0x66e3ad translate_all_program_units ../../gcc-trunk/gcc/fortran/parse.c:5328 0x66e3ad gfc_parse_file() ../../gcc-trunk/gcc/fortran/parse.c:5538 0x6ae745 gfc_be_parse_file ../../gcc-trunk/gcc/fortran/f95-lang.c:228 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. It's not clear to me if this is invalid code - see the discussion for PR573= 05 on how SIZEOF() should work on variables without a declared type. I checked that the testcase for PR57305 still compiles successfully. Wrapping the call to SIZEOF() inside a "SELECT TYPE" block removes the ICE.= =20 Replacing SIZEOF() with STORAGE_SIZE() (as suggested in PR57305) results in= a slightly different backtrace: $ gfortran -c small.f90 -o small.o small.f90:7:0: write (0,*) storage_size(ns) 1 internal compiler error: Segmentation fault 0xb7572f crash_signal ../../gcc-trunk/gcc/toplev.c:383 0x70689e gfc_conv_intrinsic_storage_size ../../gcc-trunk/gcc/fortran/trans-intrinsic.c:6067 0x70e8b9 gfc_conv_intrinsic_function(gfc_se*, gfc_expr*) ../../gcc-trunk/gcc/fortran/trans-intrinsic.c:8189 0x6ece32 gfc_conv_expr(gfc_se*, gfc_expr*) ../../gcc-trunk/gcc/fortran/trans-expr.c:7361 0x6f3685 gfc_conv_expr_reference(gfc_se*, gfc_expr*) ../../gcc-trunk/gcc/fortran/trans-expr.c:7496 0x7150c1 gfc_trans_transfer(gfc_code*) ../../gcc-trunk/gcc/fortran/trans-io.c:2394 0x6b18d7 trans_code ../../gcc-trunk/gcc/fortran/trans.c:1885 0x7121b0 build_dt ../../gcc-trunk/gcc/fortran/trans-io.c:1921 0x6b18f7 trans_code ../../gcc-trunk/gcc/fortran/trans.c:1857 0x6de1df gfc_generate_function_code(gfc_namespace*) ../../gcc-trunk/gcc/fortran/trans-decl.c:5896 0x6b6149 gfc_generate_module_code(gfc_namespace*) ../../gcc-trunk/gcc/fortran/trans.c:2053 0x66e3ad translate_all_program_units ../../gcc-trunk/gcc/fortran/parse.c:5328 0x66e3ad gfc_parse_file() ../../gcc-trunk/gcc/fortran/parse.c:5538 0x6ae745 gfc_be_parse_file ../../gcc-trunk/gcc/fortran/f95-lang.c:228 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. >>From gcc-bugs-return-484633-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Apr 25 16:33:04 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 95572 invoked by alias); 25 Apr 2015 16:33:04 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 95457 invoked by uid 48); 25 Apr 2015 16:33:00 -0000 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/65888] Need a way to disable copy relocations Date: Sat, 25 Apr 2015 16:33:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status resolution Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg02185.txt.bz2 Content-length: 478 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65888 H.J. Lu changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |DUPLICATE --- Comment #1 from H.J. Lu --- Dup. *** This bug has been marked as a duplicate of bug 65886 ***