This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran] Fix PR 19479: Simplification of the {L|U}BOUND intrinsics
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Tobias Schl?ter <tobias dot schlueter at physik dot uni-muenchen dot de>
- Cc: GCC Fortran mailing list <fortran at gcc dot gnu dot org>, patch <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 28 Feb 2005 12:49:48 -0800
- Subject: Re: [gfortran] Fix PR 19479: Simplification of the {L|U}BOUND intrinsics
- References: <4221D06A.8070905@physik.uni-muenchen.de>
On Sun, Feb 27, 2005 at 02:51:38PM +0100, Tobias Schl?ter wrote:
>
> This patch fixes the simplification of the UBOUND and LBOUND intrinsics.
> Previously they would get confused if there were component references in the
> reference chain. The attached testcase segfaults before the patch and passes
> afterwards.
>
> Bubblestrapped and tested on i686-pc-linux. This patch is ported from g95,
> but I simplified the logic and chose non-obfuscated variable names. Ok for
> mainline and the branch?
>
> - Tobi
>
> 2005-02-27 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
> (port from g95)
>
> PR fortran/19479
> * simplify.c (gfc_simplify_bound): Overhaul.
>
I've looked over this patch and I've bubblestrap/regtested on
amd64-*-freebsd6.0. This OK to commit, once you check possible
whitespace problems.
>From your patch:
--- 1785,1841 ----
/* Follow any component references. */
as = array->symtree->n.sym->as;
for (ref = array->ref; ref; ref = ref->next)
switch (ref->type)
{
case REF_ARRAY:
switch (ref->u.ar.type)
{
case AR_ELEMENT:
as = NULL;
continue;
case AR_FULL:
/* We're done because 'as' has already been set in the
previous iteration. */
goto done;
case AR_SECTION:
case AR_UNKNOWN:
return NULL;
}
gcc_unreachable ();
case REF_COMPONENT:
as = ref->u.c.component->as;
continue;
case REF_SUBSTRING:
continue;
}
The above appears to have whitespace problems. Yes, I
looked at the attached patch outside of my mail agent,
so tabs were preserved and set to 8 space.
--
Steve