mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-03 05:10:26 +08:00
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:
parent
93a85f02f1
commit
abc2dd3c9e
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
20
gcc/testsuite/gcc.c-torture/compile/20070915-1.c
Normal file
20
gcc/testsuite/gcc.c-torture/compile/20070915-1.c
Normal 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;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user