This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Re: GCSE


Btw, here is a sample patch of how to disable gcse for functions that
use computed gotos.  Maybe it can be extended with a command line
option -fgcse-no-gotos

Ok for mainline? :)

g.

--- function.h	2005-01-05 13:33:32.000000000 -0800
+++ orig.function.h	2005-01-05 10:27:35.000000000 -0800
@@ -380,9 +380,6 @@
     function.  */
  unsigned int has_nonlocal_goto : 1;

-  /* Nonzero if function uses computed goto.  */
-  unsigned int uses_computed_goto : 1;
-
  /* Nonzero if function being compiled contains nested functions.  */
  unsigned int contains_functions : 1;

@@ -474,7 +471,6 @@
#define current_function_epilogue_delay_list (cfun->epilogue_delay_list)
#define current_function_has_nonlocal_label (cfun->has_nonlocal_label)
#define current_function_has_nonlocal_goto (cfun->has_nonlocal_goto)
-#define current_function_uses_computed_goto (cfun->uses_computed_goto)

#define return_label (cfun->x_return_label)
#define naked_return_label (cfun->x_naked_return_label)
--- stmt.c	2005-01-05 13:34:13.000000000 -0800
+++ orig.stmt.c	2005-01-05 10:28:05.000000000 -0800
@@ -182,8 +182,6 @@
void
expand_computed_goto (tree exp)
{
-  current_function_uses_computed_goto = 1;
-
  rtx x = expand_expr (exp, NULL_RTX, VOIDmode, 0);

  x = convert_memory_address (Pmode, x);
--- gcse.c	2005-01-05 13:34:42.000000000 -0800
+++ orig.gcse.c	2005-01-05 10:28:21.000000000 -0800
@@ -682,9 +682,6 @@
  if (current_function_calls_setjmp)
    return 0;

-  if (current_function_uses_computed_goto)
-    return 0;
-
  /* Assume that we do not need to run jump optimizations after gcse.  */
  run_jump_opt_after_gcse = 0;




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]