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:
Richard Henderson 2004-03-02 16:18:12 -08:00 committed by Richard Henderson
parent 3a75069d35
commit 0eadce5226
3 changed files with 31 additions and 1 deletions

View File

@ -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>
* config/m68hc11/m68hc11.c (m68hc11_addr_mode): New variable.

View File

@ -524,9 +524,9 @@ expand_computed_goto (tree exp)
{
cfun->computed_goto_common_reg = copy_to_mode_reg (Pmode, x);
cfun->computed_goto_common_label = gen_label_rtx ();
emit_label (cfun->computed_goto_common_label);
do_pending_stack_adjust ();
emit_label (cfun->computed_goto_common_label);
emit_indirect_jump (cfun->computed_goto_common_reg);
current_function_has_computed_jump = 1;

View File

@ -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;
}