This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
bug in combine_stack_adjustments
- To: rth at cygnus dot com
- Subject: bug in combine_stack_adjustments
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Fri, 17 Mar 2000 14:42:15 -0700
- cc: gcc at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
Compile on the x86 with -O2:
typedef union tree_node *tree;
struct tree_common
{
union tree_node *type;
};
typedef struct {
int r[(11 + sizeof (int))/(sizeof (int))];
} realvaluetype;
extern realvaluetype ereal_negate (realvaluetype);
union real_extract
{
realvaluetype d;
int i[sizeof (realvaluetype) / sizeof (int)];
};
union tree_node;
struct tree_real_cst
{
realvaluetype real_cst;
};
union tree_node
{
struct tree_common common;
struct tree_real_cst real_cst;
};
tree
fold (expr)
tree expr;
{
register tree t = expr;
tree type = ((expr)->common.type);
register tree arg0 = (tree) ((void *)0), arg1 = (tree) ((void *)0);
t = build_real (type, ereal_negate (((arg0)->real_cst.real_cst)));
return t;
}
You'll find that the call to "ereal_negate" gets incorrectly deleted.
This happens during combine_stack_adjustments:
We end up calling flow_delete_insn from combine_stack_adjustments_for_block
with this insn:
(call_insn 31 30 33 (parallel[
(call (mem:QI (symbol_ref:SI ("ereal_negate")) 0)
(const_int 16 [0x10]))
(set (reg:SI 7 esp)
(plus:SI (reg:SI 7 esp)
(const_int 0 [0x0])))
] ) 452 {*call_pop_pic} (nil)
(nil)
(nil))
Obviously we can't delete a call, no matter what the status of the stack
adjustment. I also wonder if it is safe to delete stack adjustments
for call_pops, but I'll let you figure that out :-)
This causes GCC to mis-compile itself which in turn causes a number of
c-torture failures when testing the stage3 compiler.
jeff