comment. Use switch statement to catch overlaps between rtx
and tree codes. Accept FUNCTION_DECLs in addition to those in...
(IS_DECL_CODE): ... here. Remove.
(check_value_is_not_decl): Remove.
(dv_from_decl, dv_from_value): Check after conversion.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151432
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-09-04 Alexandre Oliva <aoliva@redhat.com>
+
+ * var-tracking.c (dv_is_decl_p): Adjust NULL behavior to match
+ comment. Use switch statement to catch overlaps between rtx
+ and tree codes. Accept FUNCTION_DECLs in addition to those in...
+ (IS_DECL_CODE): ... here. Remove.
+ (check_value_is_not_decl): Remove.
+ (dv_from_decl, dv_from_value): Check after conversion.
+
2009-09-04 Richard Guenther <rguenther@suse.de>
PR middle-end/41257
2009-09-04 Richard Guenther <rguenther@suse.de>
PR middle-end/41257
dv_is_decl_p (decl_or_value dv)
{
if (!dv)
dv_is_decl_p (decl_or_value dv)
{
if (!dv)
- if (GET_CODE ((rtx)dv) == VALUE)
- return false;
+ /* Make sure relevant codes don't overlap. */
+ switch ((int)TREE_CODE ((tree)dv))
+ {
+ case (int)VAR_DECL:
+ case (int)PARM_DECL:
+ case (int)RESULT_DECL:
+ case (int)FUNCTION_DECL:
+ case (int)COMPONENT_REF:
+ return true;
+ case (int)VALUE:
+ return false;
+
+ default:
+ gcc_unreachable ();
+ }
}
/* Return true if a decl_or_value is a VALUE rtl. */
}
/* Return true if a decl_or_value is a VALUE rtl. */
return dv_onepart_p (dv) ? valvar_pool : var_pool;
}
return dv_onepart_p (dv) ? valvar_pool : var_pool;
}
-#define IS_DECL_CODE(C) ((C) == VAR_DECL || (C) == PARM_DECL \
- || (C) == RESULT_DECL || (C) == COMPONENT_REF)
-
-/* Check that VALUE won't ever look like a DECL. */
-static char check_value_is_not_decl [(!IS_DECL_CODE ((enum tree_code)VALUE))
- ? 1 : -1] ATTRIBUTE_UNUSED;
-
-
/* Build a decl_or_value out of a decl. */
static inline decl_or_value
dv_from_decl (tree decl)
{
decl_or_value dv;
/* Build a decl_or_value out of a decl. */
static inline decl_or_value
dv_from_decl (tree decl)
{
decl_or_value dv;
- gcc_assert (!decl || IS_DECL_CODE (TREE_CODE (decl)));
+ gcc_assert (dv_is_decl_p (dv));
dv_from_value (rtx value)
{
decl_or_value dv;
dv_from_value (rtx value)
{
decl_or_value dv;
+ gcc_assert (dv_is_value_p (dv));