This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[patch, fortran] PR29876 - ICE on bad operator
- From: Daniel Franke <franke dot daniel at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 7 Jul 2007 20:24:38 +0200
- Subject: [patch, fortran] PR29876 - ICE on bad operator
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:to:subject:date:user-agent:cc:mime-version:content-type:message-id; b=h/dXOeFfTx9JEWtqYT1KXVMoh+DJtz+5VvbWCHJv7vYDCMg9UZiZr5ZhOq1vUE2DF4DpbIHl97GfzcD7Wdr0LWB8zMBcIjDdWqwjDEGtKCDxNWq+kSjn4VRp+NaXqNGnkBpRiYUKw2Qg9Gra55AgyLA1IruMM4f5IohCBPtApSw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:to:subject:date:user-agent:cc:mime-version:content-type:message-id; b=t6wkA5K/rZ/PoaH6r1JA2tshfu/zOGspObJE77K3z7zikYKxKB5zmfTPRyIbCTOo0QgPUGxu3u9CEFOP7ZvQIExa3zcL+6uYKxmF4p7qC5xlLSE/rxgGEV7Zd60GKhJH3O6rBwU61RnjkMw8DlVz4Mu47dsRVZgivoF785jtQDo=
Simple fix, testcase is the reporter's.
:ADDPATCH fortran:
2007-07-07 Daniel Franke <franke.daniel@gmail.com>
PR fortran/29876
* module.c (gfc_match_use): Do not set an non-existant
intrinsic operator if a user-defined operator is found.
2007-07-07 Daniel Franke <franke.daniel@gmail.com>
PR fortran/29876
* gfortran.dg/operator_6.f90: New test.
Regression tested on i686-pc-linux-gnu. Ok for trunk?
Regards
Daniel
Index: fortran/module.c
===================================================================
--- fortran/module.c (revision 126413)
+++ fortran/module.c (working copy)
@@ -651,10 +651,6 @@
"an external module name.", module_name);
goto cleanup;
}
-
- if (type == INTERFACE_USER_OP)
- new->operator = operator;
-
break;
case INTERFACE_INTRINSIC_OP:
Index: testsuite/gfortran.dg/operator_6.f90
===================================================================
--- testsuite/gfortran.dg/operator_6.f90 (revision 0)
+++ testsuite/gfortran.dg/operator_6.f90 (revision 0)
@@ -0,0 +1,12 @@
+! { dg-do compile }
+!
+! PR fortran/29876 ICE on bad operator in ONLY clause of USE statement
+! Testcase contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+!
+module foo
+end module foo
+
+program test
+ use foo, only : operator(.none.)
+ end program test
+! { dg-final { cleanup-modules "foo" } }