]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix fortran common-related error recovery ICE.
authormikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 4 Oct 2015 12:30:16 +0000 (12:30 +0000)
committermikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 4 Oct 2015 12:30:16 +0000 (12:30 +0000)
commitd2f74bc823e1eb15abb8744adbf6f0876ba58204
tree0e37a535c2fb1ad4175640b01e0f4518a0f4ece7
parenteca581b5e622c82ec53af5e6230533816ee545f2
Fix fortran common-related error recovery ICE.

Upon reverting a symbol in a common block (after throwing an error),
the compiler was ICEing because the symbol's common_block field was set,
but the symbol was not in the common block's list of symbols.

Fixed by both adding the symbol to the common block list and setting
the symbol's common_block field at the same time.
Furthermore, the gfc_add_in_common call is delayed and its result is
ignored, so that its error messages are ignored and the compiler has
the opportunity to give a better error message.
Another gfc_add_in_common call is added later during resolution
to emit again the missing errors.

PR fortran/67758
gcc/fortran/
* match.c (gfc_match_common): Delay the common_block pointer
assignment after error checking.
Delay the call to gfc_add_in_common attribute after the handling
of array specs.
* resolve.c (resolve_common_vars): Call gfc_add_in_common again.
gcc/testsuite/
* gfortran.dg/common_24.f: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228457 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/fortran/ChangeLog
gcc/fortran/match.c
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/common_24.f [new file with mode: 0644]