This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][tuples][Ada] Disable gcc_asserts in gimple_has_side_effects
On Mon, 21 Jul 2008, Richard Guenther wrote:
> On Mon, 21 Jul 2008, Richard Guenther wrote:
>
> > On Mon, 21 Jul 2008, Olivier Hainque wrote:
> >
> > > Olivier Hainque wrote:
> > > > Could you please tell a bit more about the situations where you're
> > > > seeing the failures in general, and the empty constructor case in
> > > > particular ?
> > > >
> > > > Is this while bootstrapping, building the libray, running the tests ?
> > >
> > > Just realized this was what your RTS related message on gcc@ is about.
> >
> > The assert happens when building the RTS, I'm rebuilding to get you
> > and example file.
>
> With tuples head I end up with
>
> /abuild/rguenther/tuples-g/./gcc/xgcc -B/abuild/rguenther/tuples-g/./gcc/
> -B/usr/local/x86_64-unknown-linux-gnu/bin/
> -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem
> /usr/local/x86_64-unknown-linux-gnu/include -isystem
> /usr/local/x86_64-unknown-linux-gnu/sys-include -c -g -O2 -fPIC -W
> -Wall -gnatpg g-alleve.adb -o g-alleve.o
> +===========================GNAT BUG
> DETECTED==============================+
> | 4.4.0 20080715 (experimental) (x86_64-unknown-linux-gnu) GCC error:
> |
> | in gimple_rhs_has_side_effects, at gimple.c:2370
> |
> | Error detected around g-alleve.adb:1985
> |
>
> #2 0x000000000093d7a7 in gimple_rhs_has_side_effects (s=0x7f8b406598c0)
> at /space/rguenther/src/svn/gimple-tuples-branch/gcc/gimple.c:2370
> 2370 gcc_assert (gimple_has_volatile_ops (s));
> (gdb) print s
> $1 = (const_gimple) 0x7f8b406598c0
> (gdb) call debug_gimple_stmt (s)
> # C178b_66 = VDEF <C178b_65(D)> { C178b }
> C178b = {};
>
> (gdb) call gimple_op (s, 1)
> $2 = (union tree_node *) 0x7f8b406ccc60
> (gdb) call debug_tree ($2)
> <constructor 0x7f8b406ccc60
> type <record_type 0x7f8b404636c0 gnat__altivec__vector_views__vsi_view
> readonly sizes-gimplified BLK
> size <integer_cst 0x7f8b4221cdb0 constant 128>
> unit size <integer_cst 0x7f8b4221cde0 constant 16>
> user align 128 symtab 1110011904 alias set 28 canonical type
> 0x7f8b404636c0
> fields <field_decl 0x7f8b408cb5a0 values type <record_type
> 0x7f8b408cd600 gnat__altivec__vector_views__varray_signed_int___PAD>
> BLK file g-alvevi.ads line 122 col 7 size <integer_cst
> 0x7f8b4221cdb0 128> unit size <integer_cst 0x7f8b4221cde0 16>
> user align 128 offset_align 128
> offset <integer_cst 0x7f8b422350c0 constant visited 0>
> bit offset <integer_cst 0x7f8b422350f0 constant 0> context
> <record_type 0x7f8b408cd900 gnat__altivec__vector_views__vsi_view>> Ada
> size <integer_cst 0x7f8b4221cdb0 128>>
> side-effects lngt 0>
>
> so that constructor has TREE_SIDE_EFFECTS set.
>
> I didn't yet try to track this down to either the frontend or maybe
> the gimplifier. So both could be at fault.
Actually it was simple to figure out ;) The following fixes it:
Richard.
2008-07-21 Richard Guenther <rguenther@suse.de>
* gimplify.c (gimplify_init_constructor): Clear TREE_SIDE_EFFECTS
on the remaining empty constructor.
Index: gimplify.c
===================================================================
*** gimplify.c (revision 138027)
--- gimplify.c (working copy)
*************** gimplify_init_constructor (tree *expr_p,
*** 3639,3644 ****
--- 3639,3645 ----
Note that we still have to gimplify, in order to handle the
case of variable sized types. Avoid shared tree structures. */
CONSTRUCTOR_ELTS (ctor) = NULL;
+ TREE_SIDE_EFFECTS (ctor) = 0;
object = unshare_expr (object);
gimplify_stmt (expr_p, pre_p);
}