fix ia64-hpux deferred_symbol_p failure

Steve Ellcey sje@cup.hp.com
Tue May 13 16:04:00 GMT 2003


> I.e. this duplication problem should ocurr only on targets with 
> Pmode != ptr_mode, which is why Zack didn't see it.
> 
> I believe we can instead rely on the tree constant object being 
> unique, since that pointer will be duplicated by the shallow copy.
> Which would allow us to use TREE_ASM_WRITTEN, which seems equally
> natural.
> 
> Try the following.
> 
> 
> r~
> 
> 
> 	* rtl.h (TREE_CONSTANT_POOL_ADDRESS_P): New.
> 	(DEFERRED_CONSTANT_P): Remove.
> 	* varasm.c (build_constant_desc): Set it.
> 	(maybe_output_constant_def_contents): Check TREE_ASM_WRITTEN to
> 	see if we've already output this constant.
> 	(output_constant_def_contents): Set TREE_ASM_WRITTEN.
> 	(mark_constant): Check it before calling output_constant_def_contents.

This fixes the case that I sent you but it still doesn't fix everything.
With the following test case (cut down from gengenrtl.c) and using both
of your patches I get duplicate labels in 32 and 64 bit modes.

C code:

  struct rtx_definition
  {
    const char *const enumname, *const name, *const format;
  };

  static const struct rtx_definition defs[] =
  {
        { "EXPR_LIST", "expr_list", "ee" },
        { "COND_EXEC", "cond_exec", "ee" }
  };


ASM output:


  .LC2:
        stringz "ee"
        .align 8
  .LC3:
        stringz "COND_EXEC"
        .align 8
  .LC4:
        stringz "cond_exec"
        .align 8
  .LC2:
        stringz "ee"

And later in the code:

  .LC2:
        stringz "ee"
        data8   .LC2
        .align 8
  .LC3:
        stringz "COND_EXEC"
        data8   .LC3
        .align 8
  .LC4:
        stringz "cond_exec"
        data8   .LC4
        .align 8
  .LC2:
        stringz "ee"
        data8   .LC2



Steve Ellcey
sje@cup.hp.com



More information about the Gcc-patches mailing list