1 msgGPL exception for fptr.c and milli64.s
1 msgplugin branch initial commit
6 msgSH2A: 'RTV/N Rn' implementation
1 msggcc-4.1-20070716 is now available
2 msgGCC 4.1 status on front page
2 msg[tuples] Renaming GS to GIMPLE
1 msgBasic frontend framework: Segfault on append_to...
2 msgEfficiently encoding a hierarchy
1 msgFAIL: gcc.dg/pragma-darwin.c
15 msgCan realloc be marked as a mallloc-like function?
1 msgmake clean-target fails at x86_64-unknown-linux...

valid_gimple_expression_p claims validity of in...
\ Daniel Berlin (14 Jul 2007)
. \ Eric Botcazou (14 Jul 2007)
. . \ Daniel Berlin (16 Jul 2007)

1 msggcc-4.3-20070713 is now available
1 msgGCC 4.2.1 RC2
2 msgincremental compiler project
1 msgDbase Files
1 msg[PATCH] Modulo-scheduling improvements. Patch 1...
1 msgTrouble with powerpc64 mfpgpr patch
1 msgRegarding bug 32505
4 msgkind of regression -fprofile-* between r126538 ...
Subject:Re: valid_gimple_expression_p claims validity of invalid gimple
Group:Gcc
From:Daniel Berlin
Date:16 Jul 2007


On 7/14/07, Eric Botcazou <ebotcazou> wrote:
> > First is_gimple_min_invariant in try_to_simplify where it chooses
> > DECL_INITIAL should be valid_gimple_expression_p instead.
>
> That's a known problem, see tree-ssa-ccp.c:

I had forgotten about this because i hadn't done IPA in a while. At
some point, we should just create special initializer functions and
gimplify these into them.
>
> /* The regular is_gimple_min_invariant does a shallow test of the object.
> It assumes that full gimplification has happened, or will happen on the
> object. For a value coming from DECL_INITIAL, this is not true, so we
> have to be more strict ourselves. */
>
> static bool
> ccp_decl_initial_min_invariant (tree t)
> {
> if (!is_gimple_min_invariant (t))
> return false;
> if (TREE_CODE (t) == ADDR_EXPR)
> {
> /* Inline and unroll is_gimple_addressable. */
> while (1)
> {
> t = TREE_OPERAND (t, 0);
> if (is_gimple_id (t))
> return true;
> if (!handled_component_p (t))
> return false;
> }
> }
> return true;
> }
>
> static tree
> get_symbol_constant_value (tree sym)
> {
> if (TREE_STATIC (sym)
> && TREE_READONLY (sym)
> && !MTAG_P (sym))
> {
> tree val = DECL_INITIAL (sym);
> if (val
> && ccp_decl_initial_min_invariant (val))
> return val;
> }
>
> return NULL_TREE;
> }
>
> You could turn ccp_decl_initial_min_invariant into a global predicate and
> invoke it from tree-ssa-sccvn.c on the DECL_INITIAL.
>
> > However, even if i fix this, the testcase still fails because
> > valid_gimple_expression says something that is clearly invalid is
> > valid.
> >
> > (gdb) p valid_gimple_expression_p ($2)
> > $3 = 1 '\001'
> > (gdb) p debug_generic_stmt ($2)
> > &((struct RegisterLayout *) (char *) &SimulatedRegisters)->intmask;
> >
> > This is not valid gimple by a longshot :)
>
> Almost. :-) The function was extracted unchanged from set_rhs but it looks
> like it needs to be beefed up a bit if it is to become of general use.
>
> > If you fix this part, i'll happily fix the bug report with the first part.
>
> The problem is again the ADDR_EXPR case, because it drags lvalues into the
> game. This would be something like:

I'll try this and submit it as part of my patch if it works.

Thanks a ton!


© 2004-2008 readlist.com