Commit 7604eb4e by Jakub Jelinek Committed by Jakub Jelinek

re PR other/42611 (ICE in tree_low_cst, at tree.c:5014)

	PR other/42611
	* cfgexpand.c (expand_one_var): Diagnose too large variables.

	* gcc.dg/pr42611.c: New test.

From-SVN: r155641
parent 566f27e4
2010-01-05 Jakub Jelinek <jakub@redhat.com> 2010-01-05 Jakub Jelinek <jakub@redhat.com>
PR other/42611
* cfgexpand.c (expand_one_var): Diagnose too large variables.
PR tree-optimization/42508 PR tree-optimization/42508
* tree-sra.c (convert_callers): Check for recursive call * tree-sra.c (convert_callers): Check for recursive call
by comparing cgraph nodes instead of decls. by comparing cgraph nodes instead of decls.
......
/* A pass for lowering trees to RTL. /* A pass for lowering trees to RTL.
Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -1011,6 +1011,14 @@ expand_one_var (tree var, bool toplevel, bool really_expand) ...@@ -1011,6 +1011,14 @@ expand_one_var (tree var, bool toplevel, bool really_expand)
if (really_expand) if (really_expand)
expand_one_register_var (origvar); expand_one_register_var (origvar);
} }
else if (!host_integerp (DECL_SIZE_UNIT (var), 1))
{
if (really_expand)
{
error ("size of variable %q+D is too large", var);
expand_one_error_var (var);
}
}
else if (defer_stack_allocation (var, toplevel)) else if (defer_stack_allocation (var, toplevel))
add_stack_var (origvar); add_stack_var (origvar);
else else
......
2010-01-05 Jakub Jelinek <jakub@redhat.com> 2010-01-05 Jakub Jelinek <jakub@redhat.com>
PR other/42611
* gcc.dg/pr42611.c: New test.
PR tree-optimization/42508 PR tree-optimization/42508
* g++.dg/opt/pr42508.C: New test. * g++.dg/opt/pr42508.C: New test.
......
/* PR other/42611 */
/* { dg-do compile } */
/* { dg-options "" } */
#define L \
(sizeof (__SIZE_TYPE__) == 1 ? __SCHAR_MAX__ \
: sizeof (__SIZE_TYPE__) == sizeof (short) ? __SHRT_MAX__ \
: sizeof (__SIZE_TYPE__) == sizeof (int) ? __INT_MAX__ \
: sizeof (__SIZE_TYPE__) == sizeof (long) ? __LONG_MAX__ \
: sizeof (__SIZE_TYPE__) == sizeof (long long) ? __LONG_LONG_MAX__ \
: __INTMAX_MAX__)
struct S { int a; char b[L]; };
void
foo (void)
{
struct S s; /* { dg-error "is too large" } */
asm volatile ("" : : "r" (&s));
}
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