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]

Re: [PATCH] Fix ICE in arm_function_in_section_p (PR target/38695)


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
>


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