This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch, fortran, committed] Fix argument kind in gfc_resolve_ishftc


This patch fixes an obvious bug in gfc_resolve_ishftc; s_kind is supposed to be the kind of the size argument if it exists, but is instead set to the kind of the shift argument.

I tried to find a testcase that broke without this patch, but I couldn't find one. After a bit of investigation, I've concluded that this function (and probably quite a bit more of iresolve.c) is currently dead code, representing resolvers for nonexistent specific forms of generic intrinsics, where the generics are resolved in trans-intrinsic.c.

Thus, at some point, I'll probably look at trying to prune out the dead code and simplify things. In the meantime, can anyone comment on whether this is really dead or whether I'm missing something?

In the meantime, I've committed this fix to trunk as obvious. I don't see any point in backporting it to 4.2, but it might be useful on trunk if the code ends up resurrected someday.

------------------------------------------------------------------
2007-03-07  Brooks Moses  <brooks.moses@codesourcery.com>

* iresolve.c (gfc_resolve_ishftc): Correct s_kind value.

------------------------------------------------------------------

- Brooks
Index: iresolve.c
===================================================================
--- iresolve.c	(revision 122595)
+++ iresolve.c	(working copy)
@@ -988,7 +988,7 @@
 {
   int s_kind;
 
-  s_kind = (size == NULL) ? gfc_default_integer_kind : shift->ts.kind;
+  s_kind = (size == NULL) ? gfc_default_integer_kind : size->ts.kind;
 
   f->ts = i->ts;
   f->value.function.name

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]