[Bug fortran/64933] ASSOCIATE on a character variable does not allow substring expressions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64933 Paul Thomas changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #6 from Paul Thomas --- Fixed on 11/04/16 :-) Thanks for the report. Paul
[Bug fortran/64933] ASSOCIATE on a character variable does not allow substring expressions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64933 --- Comment #5 from Paul Thomas --- Author: pault Date: Fri Nov 4 19:23:44 2016 New Revision: 241860 URL: https://gcc.gnu.org/viewcvs?rev=241860=gcc=rev Log: 2016-04-19 Paul ThomasPR fortran/64933 * primary.c (gfc_match_varspec): If selector expression is unambiguously an array, make sure that the associate name is an array and has an array spec. Modify the original condition for doing this to exclude character types. 2016-04-19 Paul Thomas PR fortran/64933 * gfortran.dg/associate_23.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/associate_23.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/primary.c trunk/gcc/testsuite/ChangeLog
[Bug fortran/64933] ASSOCIATE on a character variable does not allow substring expressions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64933 --- Comment #4 from Paul Thomas --- Created attachment 39941 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39941=edit Draft Patch for the PR Bootstraps and regtests on FC21/x86_64. This testcase runs fine: program test_this implicit none character(len = 15) :: char_var, char_var_dim (3) character(len = 80) :: buffer ! Original failing case reported in PR ASSOCIATE(should_work=>char_var) should_work = "test succesful" write (buffer, *) should_work(5:14) END ASSOCIATE if (trim (buffer) .ne. " succesful") call abort ! Found to be failing during debugging ASSOCIATE(should_work=>char_var_dim) should_work = ["test SUCCESFUL", "test_SUCCESFUL", "test.SUCCESFUL"] write (buffer, *) should_work(:)(5:14) END ASSOCIATE if (trim (buffer) .ne. " SUCCESFUL_SUCCESFUL.SUCCESFUL") call abort ! Found to be failing during debugging ASSOCIATE(should_work=>char_var_dim(1:2)) should_work = ["test SUCCESFUL", "test_SUCCESFUL", "test.SUCCESFUL"] write (buffer, *) should_work(:)(5:14) END ASSOCIATE if (trim (buffer) .ne. " SUCCESFUL_SUCCESFUL") call abort end program I'll submit and commit this weekend. Paul
[Bug fortran/64933] ASSOCIATE on a character variable does not allow substring expressions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64933 Dominique d'Humieres dominiq at lps dot ens.fr changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2015-02-13 CC||pault at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #2 from Dominique d'Humieres dominiq at lps dot ens.fr --- Up to revision r219797 (2015-01-17), I get the error pr64933.f90:5:31: ASSOCIATE(should_work=char_var) 1 Error: Associate-name 'should_work' at (1) is used as array Starting at r219823 (2015-01-18) I get the ICE. Likely a fall out of r219814 (pr55901). Please feel free to mark this PR as a 5.0 regression.
[Bug fortran/64933] ASSOCIATE on a character variable does not allow substring expressions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64933 Paul Thomas pault at gcc dot gnu.org changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |pault at gcc dot gnu.org --- Comment #3 from Paul Thomas pault at gcc dot gnu.org --- (In reply to Dominique d'Humieres from comment #2) Up to revision r219797 (2015-01-17), I get the error pr64933.f90:5:31: ASSOCIATE(should_work=char_var) 1 Error: Associate-name 'should_work' at (1) is used as array Starting at r219823 (2015-01-18) I get the ICE. Likely a fall out of r219814 (pr55901). Please feel free to mark this PR as a 5.0 regression. Hmm! I am not sure that it can be regarded as a regression, since the original error was wrong. I agree that an ICE is worse -ish. I'll take it though, regression or not. Paul
[Bug fortran/64933] ASSOCIATE on a character variable does not allow substring expressions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64933 --- Comment #1 from Olivier Marsden olivier.marsden at ecmwf dot int --- Comment on attachment 34662 -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=34662 gfortran 5.0 ICE output for test case print *, should_work(5:15) 1 internal compiler error: Segmentation fault 0xb7c62f crash_signal ../../gcc-5-20150201/gcc/toplev.c:383 0x6ebf4b gfc_conv_scalarized_array_ref ../../gcc-5-20150201/gcc/fortran/trans-array.c:3068 0x6ec911 gfc_conv_array_ref(gfc_se*, gfc_array_ref*, gfc_expr*, locus*) ../../gcc-5-20150201/gcc/fortran/trans-array.c:3205 0x719865 gfc_conv_variable ../../gcc-5-20150201/gcc/fortran/trans-expr.c:2203 0x716f92 gfc_conv_expr(gfc_se*, gfc_expr*) ../../gcc-5-20150201/gcc/fortran/trans-expr.c:6836 0x71c3e4 gfc_conv_expr_reference(gfc_se*, gfc_expr*) ../../gcc-5-20150201/gcc/fortran/trans-expr.c:6928 0x742c0f gfc_trans_transfer(gfc_code*) ../../gcc-5-20150201/gcc/fortran/trans-io.c:2394 0x6e2777 trans_code ../../gcc-5-20150201/gcc/fortran/trans.c:1853 0x740670 build_dt ../../gcc-5-20150201/gcc/fortran/trans-io.c:1921 0x6e2797 trans_code ../../gcc-5-20150201/gcc/fortran/trans.c:1825 0x75a11c gfc_trans_block_construct(gfc_code*) ../../gcc-5-20150201/gcc/fortran/trans-stmt.c:1457 0x6e2887 trans_code ../../gcc-5-20150201/gcc/fortran/trans.c:1755 0x70e088 gfc_generate_function_code(gfc_namespace*) ../../gcc-5-20150201/gcc/fortran/trans-decl.c:5844 0x69f880 translate_all_program_units ../../gcc-5-20150201/gcc/fortran/parse.c:5341 0x69f880 gfc_parse_file() ../../gcc-5-20150201/gcc/fortran/parse.c:5538 0x6df605 gfc_be_parse_file ../../gcc-5-20150201/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.