This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Dissociate store_expr's temp from exp so that it is not marked as addressable
- From: Martin Jambor <mjambor at suse dot cz>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: Richard Guenther <rguenther at suse dot de>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 17 Apr 2012 12:09:32 +0200
- Subject: Re: [PATCH] Dissociate store_expr's temp from exp so that it is not marked as addressable
- References: <20120412154407.GA14221@virgil.arch.suse.de> <email@example.com>
On Thu, Apr 12, 2012 at 07:21:12PM +0200, Eric Botcazou wrote:
> > Well, the commit did not add a testcase and when I looked up the patch
> > in the mailing list archive
> > (http://gcc.gnu.org/ml/gcc-patches/2006-11/msg01449.html) it said it
> > was fixing problems not reproducible on trunk so it's basically
> > impossible for me to evaluate whether it is still necessary by some
> > simple testing. Having said that, I guess I can give it a round of
> > regular testing on all the platforms I have currently set up.
> The problem was that, for the same address, you had the alias set of the type
> on one MEM and the alias set of the reference on the other MEM. If the alias
> set of the reference doesn't conflict with that of the type (this can happen
> in Ada because of DECL_NONADDRESSABLE_P), the RAW dependency may be missed.
> If we don't put the alias set of the reference on one of the MEM, then I don't
> think that we need to put it on the other MEM. That's what's done for the
> first, non-bitfield temporary now.
> > 2012-04-10 Martin Jambor <firstname.lastname@example.org>
> > * expr.c (expand_expr_real_1): Pass type, not the expression, to
> > set_mem_attributes for a memory temporary. Do not call the function
> > for the memory temporary created for a bitfield.
> Fine with me, but the now dangling code in the bitfield case is a bit annoying.
In order to alleviate that feeling, I'd like to propose the following
patch, which I have successfully bootstrapped and tested on
x86_64-linux (including Ada and obj-c++), i686-linux (likewise),
sparc64-linux (with Ada but without Java), ia64-linux (default
languages, i.e. without Ada) and ppc64-linux (likewise). Testsuite
run (no bootstrap) on hppa-linux (C and C++ only) is still running and
I expect to have results tomorrow.
Thus, OK for trunk?
2012-04-16 Martin Jambor <email@example.com>
* expr.c (expand_expr_real_1): Remove setting parent's alias set for
temporaries created for a bitfield (reverting revision 122014).
@@ -9866,19 +9866,11 @@ expand_expr_real_1 (tree exp, rtx target
necessarily be constant. */
if (mode == BLKmode)
- HOST_WIDE_INT size = GET_MODE_BITSIZE (ext_mode);
- /* If the reference doesn't use the alias set of its type,
- we cannot create the temporary using that type. */
- if (component_uses_parent_alias_set (exp))
- new_rtx = assign_stack_local (ext_mode, size, 0);
- set_mem_alias_set (new_rtx, get_alias_set (exp));
- new_rtx = assign_stack_temp_for_type (ext_mode, size, 0, type);
+ new_rtx = assign_stack_temp_for_type (ext_mode,
+ GET_MODE_BITSIZE (ext_mode),
+ 0, type);
emit_move_insn (new_rtx, op0);
op0 = copy_rtx (new_rtx);
PUT_MODE (op0, BLKmode);