Commit b1b95093 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/52074 (ICE: RTL flag check: MEM_VOLATILE_P used with unexpected…

re PR middle-end/52074 (ICE: RTL flag check: MEM_VOLATILE_P used with unexpected rtx code 'plus' in extract_fixed_bit_field, at expmed.c:1734)

	PR middle-end/52074
	* expr.c (expand_expr_addr_expr_1): For CONSTANT_CLASS_P or CONST_DECL
	if modifier < EXPAND_SUM call force_operand on the result.

	* gcc.c-torture/compile/pr52074.c: New test.

From-SVN: r183956
parent b59cbd50
2012-02-07 Jakub Jelinek <jakub@redhat.com>
PR middle-end/52074
* expr.c (expand_expr_addr_expr_1): For CONSTANT_CLASS_P or CONST_DECL
if modifier < EXPAND_SUM call force_operand on the result.
2012-02-07 Joern Rennecke <joern.rennecke@embecosm.com> 2012-02-07 Joern Rennecke <joern.rennecke@embecosm.com>
* config/epiphany/epiphany.h (ASM_DECLARE_FUNCTION_SIZE): Redefine, * config/epiphany/epiphany.h (ASM_DECLARE_FUNCTION_SIZE): Redefine,
......
...@@ -7414,7 +7414,12 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -7414,7 +7414,12 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode,
generating ADDR_EXPR of something that isn't an LVALUE. The only generating ADDR_EXPR of something that isn't an LVALUE. The only
exception here is STRING_CST. */ exception here is STRING_CST. */
if (CONSTANT_CLASS_P (exp)) if (CONSTANT_CLASS_P (exp))
return XEXP (expand_expr_constant (exp, 0, modifier), 0); {
result = XEXP (expand_expr_constant (exp, 0, modifier), 0);
if (modifier < EXPAND_SUM)
result = force_operand (result, target);
return result;
}
/* Everything must be something allowed by is_gimple_addressable. */ /* Everything must be something allowed by is_gimple_addressable. */
switch (TREE_CODE (exp)) switch (TREE_CODE (exp))
...@@ -7433,7 +7438,11 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -7433,7 +7438,11 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode,
case CONST_DECL: case CONST_DECL:
/* Expand the initializer like constants above. */ /* Expand the initializer like constants above. */
return XEXP (expand_expr_constant (DECL_INITIAL (exp), 0, modifier), 0); result = XEXP (expand_expr_constant (DECL_INITIAL (exp),
0, modifier), 0);
if (modifier < EXPAND_SUM)
result = force_operand (result, target);
return result;
case REALPART_EXPR: case REALPART_EXPR:
/* The real part of the complex number is always first, therefore /* The real part of the complex number is always first, therefore
......
2012-02-07 Jakub Jelinek <jakub@redhat.com>
PR middle-end/52074
* gcc.c-torture/compile/pr52074.c: New test.
2012-02-07 Tobias Burnus <burnus@net-b.de> 2012-02-07 Tobias Burnus <burnus@net-b.de>
PR fortran/51514 PR fortran/51514
......
/* PR middle-end/52074 */
struct S { const char *d, *e; } __attribute__((packed));
void
foo (const char **p, struct S *q)
{
*p = "abcdef";
q->d = "ghijk";
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment