c-common.c (disable_builtin_function): Rename variable n to new_disabled_builtin.
* c-common.c (disable_builtin_function): Rename variable n to new_disabled_builtin. * c-decl.c (duplicate_decls): Rename parameter decl to new_decl. Rename local variable old to old_decl. * gensupport.c (shift_output_template): Rename parameter old to src. * simplify-rtx.c (simplify_replace_rtx): Rename parameter oldx to old_rtx and newx to new_rtx. From-SVN: r85175
This commit is contained in:
parent
f408614568
commit
1ad463f493
5 changed files with 60 additions and 46 deletions
|
@ -1,3 +1,13 @@
|
||||||
|
2004-07-26 Bernardo Innocenti <bernie@develer.com>
|
||||||
|
|
||||||
|
* c-common.c (disable_builtin_function): Rename variable n to
|
||||||
|
new_disabled_builtin.
|
||||||
|
* c-decl.c (duplicate_decls): Rename parameter decl to new_decl.
|
||||||
|
Rename local variable old to old_decl.
|
||||||
|
* gensupport.c (shift_output_template): Rename parameter old to src.
|
||||||
|
* simplify-rtx.c (simplify_replace_rtx): Rename parameter oldx to
|
||||||
|
old_rtx and newx to new_rtx.
|
||||||
|
|
||||||
2004-07-26 Bernardo Innocenti <bernie@develer.com>
|
2004-07-26 Bernardo Innocenti <bernie@develer.com>
|
||||||
|
|
||||||
* Makefile.in (C_PRAGMA_H): New variable to track dependencies
|
* Makefile.in (C_PRAGMA_H): New variable to track dependencies
|
||||||
|
|
|
@ -3242,10 +3242,10 @@ disable_builtin_function (const char *name)
|
||||||
error ("cannot disable built-in function `%s'", name);
|
error ("cannot disable built-in function `%s'", name);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
disabled_builtin *n = XNEW (disabled_builtin);
|
disabled_builtin *new_disabled_builtin = XNEW (disabled_builtin);
|
||||||
n->name = name;
|
new_disabled_builtin->name = name;
|
||||||
n->next = disabled_builtins;
|
new_disabled_builtin->next = disabled_builtins;
|
||||||
disabled_builtins = n;
|
disabled_builtins = new_disabled_builtin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
38
gcc/c-decl.c
38
gcc/c-decl.c
|
@ -1733,45 +1733,49 @@ duplicate_decls (tree newdecl, tree olddecl)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Check whether decl-node DECL shadows an existing declaration. */
|
/* Check whether decl-node NEW_DECL shadows an existing declaration. */
|
||||||
static void
|
static void
|
||||||
warn_if_shadowing (tree decl)
|
warn_if_shadowing (tree new_decl)
|
||||||
{
|
{
|
||||||
struct c_binding *b;
|
struct c_binding *b;
|
||||||
|
|
||||||
/* Shadow warnings wanted? */
|
/* Shadow warnings wanted? */
|
||||||
if (!warn_shadow
|
if (!warn_shadow
|
||||||
/* No shadow warnings for internally generated vars. */
|
/* No shadow warnings for internally generated vars. */
|
||||||
|| DECL_IS_BUILTIN (decl)
|
|| DECL_IS_BUILTIN (new_decl)
|
||||||
/* No shadow warnings for vars made for inlining. */
|
/* No shadow warnings for vars made for inlining. */
|
||||||
|| DECL_FROM_INLINE (decl)
|
|| DECL_FROM_INLINE (new_decl)
|
||||||
/* Don't warn about the parm names in function declarator
|
/* Don't warn about the parm names in function declarator
|
||||||
within a function declarator. It would be nice to avoid
|
within a function declarator. It would be nice to avoid
|
||||||
warning in any function declarator in a declaration, as
|
warning in any function declarator in a declaration, as
|
||||||
opposed to a definition, but there is no way to tell
|
opposed to a definition, but there is no way to tell
|
||||||
it's not a definition at this point. */
|
it's not a definition at this point. */
|
||||||
|| (TREE_CODE (decl) == PARM_DECL && current_scope->outer->parm_flag))
|
|| (TREE_CODE (new_decl) == PARM_DECL && current_scope->outer->parm_flag))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Is anything being shadowed? Invisible decls do not count. */
|
/* Is anything being shadowed? Invisible decls do not count. */
|
||||||
for (b = I_SYMBOL_BINDING (DECL_NAME (decl)); b; b = b->shadowed)
|
for (b = I_SYMBOL_BINDING (DECL_NAME (new_decl)); b; b = b->shadowed)
|
||||||
if (b->decl && b->decl != decl && !b->invisible)
|
if (b->decl && b->decl != new_decl && !b->invisible)
|
||||||
{
|
{
|
||||||
tree old = b->decl;
|
tree old_decl = b->decl;
|
||||||
|
|
||||||
if (TREE_CODE (old) == PARM_DECL)
|
if (TREE_CODE (old_decl) == PARM_DECL)
|
||||||
warning ("%Jdeclaration of '%D' shadows a parameter", decl, decl);
|
warning ("%Jdeclaration of '%D' shadows a parameter",
|
||||||
else if (DECL_FILE_SCOPE_P (old))
|
new_decl, new_decl);
|
||||||
|
else if (DECL_FILE_SCOPE_P (old_decl))
|
||||||
warning ("%Jdeclaration of '%D' shadows a global declaration",
|
warning ("%Jdeclaration of '%D' shadows a global declaration",
|
||||||
decl, decl);
|
new_decl, new_decl);
|
||||||
else if (TREE_CODE (old) == FUNCTION_DECL && DECL_BUILT_IN (old))
|
else if (TREE_CODE (old_decl) == FUNCTION_DECL
|
||||||
|
&& DECL_BUILT_IN (old_decl))
|
||||||
warning ("%Jdeclaration of '%D' shadows a built-in function",
|
warning ("%Jdeclaration of '%D' shadows a built-in function",
|
||||||
decl, decl);
|
new_decl, new_decl);
|
||||||
else
|
else
|
||||||
warning ("%Jdeclaration of '%D' shadows a previous local", decl, decl);
|
warning ("%Jdeclaration of '%D' shadows a previous local",
|
||||||
|
new_decl, new_decl);
|
||||||
|
|
||||||
if (TREE_CODE (old) != FUNCTION_DECL || !DECL_BUILT_IN (old))
|
if (TREE_CODE (old_decl) != FUNCTION_DECL
|
||||||
warning ("%Jshadowed declaration is here", old);
|
|| ! DECL_BUILT_IN (old_decl))
|
||||||
|
warning ("%Jshadowed declaration is here", old_decl);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -670,26 +670,26 @@ alter_test_for_insn (struct queue_elem *ce_elem,
|
||||||
return concat ("(", ce_test, ") && (", insn_test, ")", NULL);
|
return concat ("(", ce_test, ") && (", insn_test, ")", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Adjust all of the operand numbers in OLD to match the shift they'll
|
/* Adjust all of the operand numbers in SRC to match the shift they'll
|
||||||
get from an operand displacement of DISP. Return a pointer after the
|
get from an operand displacement of DISP. Return a pointer after the
|
||||||
adjusted string. */
|
adjusted string. */
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
shift_output_template (char *dest, const char *old, int disp)
|
shift_output_template (char *dest, const char *src, int disp)
|
||||||
{
|
{
|
||||||
while (*old)
|
while (*src)
|
||||||
{
|
{
|
||||||
char c = *old++;
|
char c = *src++;
|
||||||
*dest++ = c;
|
*dest++ = c;
|
||||||
if (c == '%')
|
if (c == '%')
|
||||||
{
|
{
|
||||||
c = *old++;
|
c = *src++;
|
||||||
if (ISDIGIT ((unsigned char) c))
|
if (ISDIGIT ((unsigned char) c))
|
||||||
c += disp;
|
c += disp;
|
||||||
else if (ISALPHA (c))
|
else if (ISALPHA (c))
|
||||||
{
|
{
|
||||||
*dest++ = c;
|
*dest++ = c;
|
||||||
c = *old++ + disp;
|
c = *src++ + disp;
|
||||||
}
|
}
|
||||||
*dest++ = c;
|
*dest++ = c;
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,38 +240,38 @@ simplify_gen_relational (enum rtx_code code, enum machine_mode mode,
|
||||||
return gen_rtx_fmt_ee (code, mode, op0, op1);
|
return gen_rtx_fmt_ee (code, mode, op0, op1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Replace all occurrences of OLDX in X with NEWX and try to simplify the
|
/* Replace all occurrences of OLD_RTX in X with NEW_RTX and try to simplify the
|
||||||
resulting RTX. Return a new RTX which is as simplified as possible. */
|
resulting RTX. Return a new RTX which is as simplified as possible. */
|
||||||
|
|
||||||
rtx
|
rtx
|
||||||
simplify_replace_rtx (rtx x, rtx oldx, rtx newx)
|
simplify_replace_rtx (rtx x, rtx old_rtx, rtx new_rtx)
|
||||||
{
|
{
|
||||||
enum rtx_code code = GET_CODE (x);
|
enum rtx_code code = GET_CODE (x);
|
||||||
enum machine_mode mode = GET_MODE (x);
|
enum machine_mode mode = GET_MODE (x);
|
||||||
enum machine_mode op_mode;
|
enum machine_mode op_mode;
|
||||||
rtx op0, op1, op2;
|
rtx op0, op1, op2;
|
||||||
|
|
||||||
/* If X is OLDX, return NEWX. Otherwise, if this is an expression, try
|
/* If X is OLD_RTX, return NEW_RTX. Otherwise, if this is an expression, try
|
||||||
to build a new expression substituting recursively. If we can't do
|
to build a new expression substituting recursively. If we can't do
|
||||||
anything, return our input. */
|
anything, return our input. */
|
||||||
|
|
||||||
if (x == oldx)
|
if (x == old_rtx)
|
||||||
return newx;
|
return new_rtx;
|
||||||
|
|
||||||
switch (GET_RTX_CLASS (code))
|
switch (GET_RTX_CLASS (code))
|
||||||
{
|
{
|
||||||
case RTX_UNARY:
|
case RTX_UNARY:
|
||||||
op0 = XEXP (x, 0);
|
op0 = XEXP (x, 0);
|
||||||
op_mode = GET_MODE (op0);
|
op_mode = GET_MODE (op0);
|
||||||
op0 = simplify_replace_rtx (op0, oldx, newx);
|
op0 = simplify_replace_rtx (op0, old_rtx, new_rtx);
|
||||||
if (op0 == XEXP (x, 0))
|
if (op0 == XEXP (x, 0))
|
||||||
return x;
|
return x;
|
||||||
return simplify_gen_unary (code, mode, op0, op_mode);
|
return simplify_gen_unary (code, mode, op0, op_mode);
|
||||||
|
|
||||||
case RTX_BIN_ARITH:
|
case RTX_BIN_ARITH:
|
||||||
case RTX_COMM_ARITH:
|
case RTX_COMM_ARITH:
|
||||||
op0 = simplify_replace_rtx (XEXP (x, 0), oldx, newx);
|
op0 = simplify_replace_rtx (XEXP (x, 0), old_rtx, new_rtx);
|
||||||
op1 = simplify_replace_rtx (XEXP (x, 1), oldx, newx);
|
op1 = simplify_replace_rtx (XEXP (x, 1), old_rtx, new_rtx);
|
||||||
if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1))
|
if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1))
|
||||||
return x;
|
return x;
|
||||||
return simplify_gen_binary (code, mode, op0, op1);
|
return simplify_gen_binary (code, mode, op0, op1);
|
||||||
|
@ -281,8 +281,8 @@ simplify_replace_rtx (rtx x, rtx oldx, rtx newx)
|
||||||
op0 = XEXP (x, 0);
|
op0 = XEXP (x, 0);
|
||||||
op1 = XEXP (x, 1);
|
op1 = XEXP (x, 1);
|
||||||
op_mode = GET_MODE (op0) != VOIDmode ? GET_MODE (op0) : GET_MODE (op1);
|
op_mode = GET_MODE (op0) != VOIDmode ? GET_MODE (op0) : GET_MODE (op1);
|
||||||
op0 = simplify_replace_rtx (op0, oldx, newx);
|
op0 = simplify_replace_rtx (op0, old_rtx, new_rtx);
|
||||||
op1 = simplify_replace_rtx (op1, oldx, newx);
|
op1 = simplify_replace_rtx (op1, old_rtx, new_rtx);
|
||||||
if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1))
|
if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1))
|
||||||
return x;
|
return x;
|
||||||
return simplify_gen_relational (code, mode, op_mode, op0, op1);
|
return simplify_gen_relational (code, mode, op_mode, op0, op1);
|
||||||
|
@ -291,9 +291,9 @@ simplify_replace_rtx (rtx x, rtx oldx, rtx newx)
|
||||||
case RTX_BITFIELD_OPS:
|
case RTX_BITFIELD_OPS:
|
||||||
op0 = XEXP (x, 0);
|
op0 = XEXP (x, 0);
|
||||||
op_mode = GET_MODE (op0);
|
op_mode = GET_MODE (op0);
|
||||||
op0 = simplify_replace_rtx (op0, oldx, newx);
|
op0 = simplify_replace_rtx (op0, old_rtx, new_rtx);
|
||||||
op1 = simplify_replace_rtx (XEXP (x, 1), oldx, newx);
|
op1 = simplify_replace_rtx (XEXP (x, 1), old_rtx, new_rtx);
|
||||||
op2 = simplify_replace_rtx (XEXP (x, 2), oldx, newx);
|
op2 = simplify_replace_rtx (XEXP (x, 2), old_rtx, new_rtx);
|
||||||
if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1) && op2 == XEXP (x, 2))
|
if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1) && op2 == XEXP (x, 2))
|
||||||
return x;
|
return x;
|
||||||
if (op_mode == VOIDmode)
|
if (op_mode == VOIDmode)
|
||||||
|
@ -304,7 +304,7 @@ simplify_replace_rtx (rtx x, rtx oldx, rtx newx)
|
||||||
/* The only case we try to handle is a SUBREG. */
|
/* The only case we try to handle is a SUBREG. */
|
||||||
if (code == SUBREG)
|
if (code == SUBREG)
|
||||||
{
|
{
|
||||||
op0 = simplify_replace_rtx (SUBREG_REG (x), oldx, newx);
|
op0 = simplify_replace_rtx (SUBREG_REG (x), old_rtx, new_rtx);
|
||||||
if (op0 == SUBREG_REG (x))
|
if (op0 == SUBREG_REG (x))
|
||||||
return x;
|
return x;
|
||||||
op0 = simplify_gen_subreg (GET_MODE (x), op0,
|
op0 = simplify_gen_subreg (GET_MODE (x), op0,
|
||||||
|
@ -317,15 +317,15 @@ simplify_replace_rtx (rtx x, rtx oldx, rtx newx)
|
||||||
case RTX_OBJ:
|
case RTX_OBJ:
|
||||||
if (code == MEM)
|
if (code == MEM)
|
||||||
{
|
{
|
||||||
op0 = simplify_replace_rtx (XEXP (x, 0), oldx, newx);
|
op0 = simplify_replace_rtx (XEXP (x, 0), old_rtx, new_rtx);
|
||||||
if (op0 == XEXP (x, 0))
|
if (op0 == XEXP (x, 0))
|
||||||
return x;
|
return x;
|
||||||
return replace_equiv_address_nv (x, op0);
|
return replace_equiv_address_nv (x, op0);
|
||||||
}
|
}
|
||||||
else if (code == LO_SUM)
|
else if (code == LO_SUM)
|
||||||
{
|
{
|
||||||
op0 = simplify_replace_rtx (XEXP (x, 0), oldx, newx);
|
op0 = simplify_replace_rtx (XEXP (x, 0), old_rtx, new_rtx);
|
||||||
op1 = simplify_replace_rtx (XEXP (x, 1), oldx, newx);
|
op1 = simplify_replace_rtx (XEXP (x, 1), old_rtx, new_rtx);
|
||||||
|
|
||||||
/* (lo_sum (high x) x) -> x */
|
/* (lo_sum (high x) x) -> x */
|
||||||
if (GET_CODE (op0) == HIGH && rtx_equal_p (XEXP (op0, 0), op1))
|
if (GET_CODE (op0) == HIGH && rtx_equal_p (XEXP (op0, 0), op1))
|
||||||
|
@ -337,8 +337,8 @@ simplify_replace_rtx (rtx x, rtx oldx, rtx newx)
|
||||||
}
|
}
|
||||||
else if (code == REG)
|
else if (code == REG)
|
||||||
{
|
{
|
||||||
if (REG_P (oldx) && REGNO (x) == REGNO (oldx))
|
if (REG_P (old_rtx) && REGNO (x) == REGNO (old_rtx))
|
||||||
return newx;
|
return new_rtx;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue