re PR middle-end/14327 (-O0 -fdefer-pop generates wrong code)
PR middle-end/14327 * stmt.c (expand_computed_goto): Do do_pending_stack_adjust before emitting the label, not after. * gcc.c-torture/execute/20040302-1.c: New. From-SVN: r78798
This commit is contained in:
parent
3a75069d35
commit
0eadce5226
|
@ -1,3 +1,9 @@
|
||||||
|
2004-03-02 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
|
PR middle-end/14327
|
||||||
|
* stmt.c (expand_computed_goto): Do do_pending_stack_adjust before
|
||||||
|
emitting the label, not after.
|
||||||
|
|
||||||
2004-03-02 Stephane Carrez <stcarrez@nerim.fr>
|
2004-03-02 Stephane Carrez <stcarrez@nerim.fr>
|
||||||
|
|
||||||
* config/m68hc11/m68hc11.c (m68hc11_addr_mode): New variable.
|
* config/m68hc11/m68hc11.c (m68hc11_addr_mode): New variable.
|
||||||
|
|
|
@ -524,9 +524,9 @@ expand_computed_goto (tree exp)
|
||||||
{
|
{
|
||||||
cfun->computed_goto_common_reg = copy_to_mode_reg (Pmode, x);
|
cfun->computed_goto_common_reg = copy_to_mode_reg (Pmode, x);
|
||||||
cfun->computed_goto_common_label = gen_label_rtx ();
|
cfun->computed_goto_common_label = gen_label_rtx ();
|
||||||
emit_label (cfun->computed_goto_common_label);
|
|
||||||
|
|
||||||
do_pending_stack_adjust ();
|
do_pending_stack_adjust ();
|
||||||
|
emit_label (cfun->computed_goto_common_label);
|
||||||
emit_indirect_jump (cfun->computed_goto_common_reg);
|
emit_indirect_jump (cfun->computed_goto_common_reg);
|
||||||
|
|
||||||
current_function_has_computed_jump = 1;
|
current_function_has_computed_jump = 1;
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
int code[]={0,0,0,0,1};
|
||||||
|
|
||||||
|
void foo(int x) {
|
||||||
|
volatile int b;
|
||||||
|
b = 0xffffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
void bar(int *pc) {
|
||||||
|
static const void *l[] = {&&lab0, &&end};
|
||||||
|
|
||||||
|
foo(0);
|
||||||
|
goto *l[*pc];
|
||||||
|
lab0:
|
||||||
|
foo(0);
|
||||||
|
pc++;
|
||||||
|
goto *l[*pc];
|
||||||
|
end:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
bar(code);
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue