This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ICE in arm_function_in_section_p (PR target/38695)
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Nick Clifton <nickc at redhat dot com>, Richard Earnshaw <richard dot earnshaw at arm dot com>, Paul Brook <paul at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Sat, 10 Jan 2009 14:48:03 +0100
- Subject: Re: [PATCH] Fix ICE in arm_function_in_section_p (PR target/38695)
- References: <20090110131940.GC25055@tyan-ft48-01.lab.bos.redhat.com>
On Sat, Jan 10, 2009 at 2:19 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> pr37433.c testcase fails on ARM, because SYMBOL_REF_DECL of the called
> symbol isn't necessarily FUNCTION_DECL, in the testcase it is STRING_CST,
> could be VAR_DECL etc. DECL_SECTION_NAME isn't defined for STRING_CST,
> nor other macros. Fixed by only trying sibcall if decl is a FUNCTION_DECL.
> Other ports also check tree code before using DECL_SECTIO_NAME etc.
>
> Laurent regtested this on arm, see
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38695#c6
> Ok for trunk?
I think it makes more sense to test this at the only callsite - after all
"function X in section S?" isn't a meaningful question if X isn't a
function - and thus doesn't have a meaningful answer.
Ok if you move the test (and add an assert into arm_function_in_section_p
if you like).
Thanks,
Richard.
> 2009-01-10 Jakub Jelinek <jakub@redhat.com>
>
> PR target/38695
> * config/arm/arm.c (arm_function_in_section_p): Return false
> for decl other than FUNCTION_DECL.
>
> --- gcc/config/arm/arm.c.jj 2008-12-27 10:12:25.000000000 +0100
> +++ gcc/config/arm/arm.c 2009-01-07 18:55:11.000000000 +0100
> @@ -3310,6 +3310,9 @@ arm_set_default_type_attributes (tree ty
> static bool
> arm_function_in_section_p (tree decl, section *section)
> {
> + if (TREE_CODE (decl) != FUNCTION_DECL)
> + return false;
> +
> /* We can only be certain about functions defined in the same
> compilation unit. */
> if (!TREE_STATIC (decl))
>
> Jakub
>