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: [lto][patch] Serialize RESX_EXPR properly. Implement lang_hooks.make_addressable for lto1.


On Tue, Aug 26, 2008 at 03:43, Bill Maddox <maddox@google.com> wrote:
> 1) Read RESX_EXPR operand correctly.  Examples that actually generate RESX_EXPR
> nodes still fail, as we do not stream in the exception regions to
> which they refer.  See
> input_eh_regions in lto-function-in.c.

Yeah, I've noticed that the code to emit EH regions is disabled.
I will reenable/fix it after I finish the tuples merge from
mainline.

>  #include "tree-iterator.h"
>
> +extern void mark_addressable (tree);  /* Used by lto/lto-lang.c */

No need to comment what file uses it.

> --- gcc/lto/lto-lang.c	(revision 139588)
> +++ gcc/lto/lto-lang.c	(working copy)
> @@ -32,6 +32,7 @@ Boston, MA 02110-1301, USA.  */
>  #include "lto-tree.h"
>  #include "lto.h"
>  #include "tree-inline.h"
> +#include "tree-gimple.h"	/* mark_addressable */

No comment needed.  The dependencies in lto/Make-lang.in need to
be updated as well.

>  static bool
> -lto_mark_addressable (tree t ATTRIBUTE_UNUSED)
> +lto_mark_addressable (tree t)
>  {
> -  gcc_unreachable ();
> +  /* This must only be called on gimplified expressions.
> +     It appears that lang_hooks.mark_addressable is called
> +     only from stmt.c during expansion of asm-statement
> +     operands.  */
> +  mark_addressable (t);

This comment is not really applicable here.  Everything we do
in lto1 is by definition gimple already.

> +	/* FIXME lto: The operands should be gimplified at this
> +	   point, so it should be safe just to call mark_addressable
> +	   here.  Gimplification may keep language-specific checks
> +	   in the langhook from working as expected.  These belong
> +	   in the front-ends.  */
>  	lang_hooks.mark_addressable (val);

Just call mark_addressable() here.  Any diagnostic messages
should've been emitted by now.

> @@ -771,6 +776,11 @@ expand_asm_operands (tree string, tree o
>  	return;
>
>        if (! allows_reg && allows_mem)
> +	/* FIXME lto: The operands should be gimplified at this
> +	   point, so it should be safe just to call mark_addressable
> +	   here.  Gimplification may keep language-specific checks
> +	   in the langhook from working as expected.  These belong
> +	   in the front-ends.  */
>  	lang_hooks.mark_addressable (TREE_VALUE (tail));

Likewise.


OK with those changes.


Diego.


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