This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/26004] [4.1/4.2 Regression] gcc errors on valid code [SVO]
- From: "amylaar at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jan 2006 18:29:55 -0000
- Subject: [Bug c/26004] [4.1/4.2 Regression] gcc errors on valid code [SVO]
- References: <bug-26004-12087@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from amylaar at gcc dot gnu dot org 2006-01-30 18:29 -------
(In reply to comment #3)
> This is caused by the following code in gimplifier:
> 3297 if (use_target)
> 3298 {
> 3299 CALL_EXPR_RETURN_SLOT_OPT (*from_p) = 1;
> 3300 lang_hooks.mark_addressable (*to_p);
> 3301 }
>
>
> Should we really be calling lang_hooks.mark_addressable, here?
>
I think the problem is actually not testing properly if the value is a
register variable first.
A few lines before in gimplify.c:gimplify_modify_expr_rhs, we have:
else if (is_gimple_reg_type (TREE_TYPE (*to_p)))
/* Also don't force regs into memory. */
use_target = false;
However, is_gimple_reg_type merely looks if the type is an aggregate.
The test that c-typeck.c:c_mark_addressable uses tests C_DECL_REGISTER .
It appears we actually don't have any way to query from the
frontend-indenpendent code if we can mark something as
safely.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26004