re PR middle-end/33423 (internal compiler error: in expand_expr_real_1, at expr.c:8670)

PR middle-end/33423
	* builtins.c (expand_builtin_memory_chk): Handle COMPOUND_EXPRs
	returned by build_call_expr.

	* gcc.c-torture/compile/20070915-1.c: New test.

From-SVN: r128554
This commit is contained in:
Jakub Jelinek 2007-09-18 00:05:40 +02:00 committed by Jakub Jelinek
parent 93a85f02f1
commit abc2dd3c9e
4 changed files with 45 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2007-09-18 Jakub Jelinek <jakub@redhat.com>
PR middle-end/33423
* builtins.c (expand_builtin_memory_chk): Handle COMPOUND_EXPRs
returned by build_call_expr.
2007-09-17 Eric Botcazou <ebotcazou@adacore.com>
* tree-sra.c (maybe_lookup_element_for_expr) <COMPONENT_REF>: Return

View File

@ -11558,6 +11558,13 @@ expand_builtin_memory_chk (tree exp, rtx target, enum machine_mode mode,
return NULL_RTX;
fn = build_call_expr (fn, 3, dest, src, len);
STRIP_TYPE_NOPS (fn);
while (TREE_CODE (fn) == COMPOUND_EXPR)
{
expand_expr (TREE_OPERAND (fn, 0), const0_rtx, VOIDmode,
EXPAND_NORMAL);
fn = TREE_OPERAND (fn, 1);
}
if (TREE_CODE (fn) == CALL_EXPR)
CALL_EXPR_TAILCALL (fn) = CALL_EXPR_TAILCALL (exp);
return expand_expr (fn, target, mode, EXPAND_NORMAL);
@ -11606,6 +11613,13 @@ expand_builtin_memory_chk (tree exp, rtx target, enum machine_mode mode,
if (!fn)
return NULL_RTX;
fn = build_call_expr (fn, 4, dest, src, len, size);
STRIP_TYPE_NOPS (fn);
while (TREE_CODE (fn) == COMPOUND_EXPR)
{
expand_expr (TREE_OPERAND (fn, 0), const0_rtx, VOIDmode,
EXPAND_NORMAL);
fn = TREE_OPERAND (fn, 1);
}
if (TREE_CODE (fn) == CALL_EXPR)
CALL_EXPR_TAILCALL (fn) = CALL_EXPR_TAILCALL (exp);
return expand_expr (fn, target, mode, EXPAND_NORMAL);

View File

@ -1,3 +1,8 @@
2007-09-18 Jakub Jelinek <jakub@redhat.com>
PR middle-end/33423
* gcc.c-torture/compile/20070915-1.c: New test.
2007-09-17 Tobias Burnus <burnus@net-b.de>
PR fortran/33106

View File

@ -0,0 +1,20 @@
/* PR middle-end/33423 */
static struct
{
char buf[15];
} u2;
void
test6 (void)
{
int len;
char *p;
for (len = 0; len < 2; len++)
{
p = __builtin___memset_chk (u2.buf, '\0', len, 15);
if (p != u2.buf)
return;
}
}