This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31067] MINLOC should sometimes be inlined (gas_dyn is sooooo sloooow)
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Mar 2007 19:43:23 -0000
- Subject: [Bug fortran/31067] MINLOC should sometimes be inlined (gas_dyn is sooooo sloooow)
- References: <bug-31067-10259@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from tkoenig at gcc dot gnu dot org 2007-03-11 19:43 -------
I have looked at this some more. Channging gfc_conv_intrinsic_function so that
we call gfc_conv_intrinsic_minmaxloc is easy enough:
@@ -3481,7 +3481,9 @@ gfc_conv_intrinsic_function (gfc_se * se
name = &expr->value.function.name[2];
- if (expr->rank > 0 && !expr->inline_noncopying_intrinsic)
+ if (expr->rank > 0 && !expr->inline_noncopying_intrinsic
+ && ! (expr->rank == 1 && (isym->generic_id == GFC_ISYM_MINLOC
+ || isym->generic_id == GFC_ISYM_MAXLOC)))
{
lib = gfc_is_intrinsic_libcall (expr);
if (lib != 0)
If we do that, we hit the "if (se->ss)" contition on top of that function, and
we would have to handle scalarization of that one-trip loop. I have currently
no idea how to go about that. Simply removing the condition doesn't work :-)
As a workaround, one could always use "minloc(...,dim=1)", then
we get the inline version.
Unassigning myself.
--
tkoenig at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|tkoenig at gcc dot gnu dot |unassigned at gcc dot gnu
|org |dot org
Status|ASSIGNED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31067