This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Gimplification and simplification
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc at gcc dot gnu dot org, law at redhat dot com
- Date: Wed, 5 Nov 2003 16:18:45 +0100
- Subject: Gimplification and simplification
Hi,
My RTL expansion code requires conditional jumps to be expanded to
conditional jumps. Unforutnately we seem to be maintaining some of
obviously unconditional jumps, like if (0==0).
These may get constructed at gimplfication time via simplfying builtins.
Like if (strlen("")). We end up not folding this to constant at all.
What is the proper place to do this optimization? At the moment I am
using attached patch, but proper sollution seems to be either teaching
dominator optimizations to try fold each gimple stmt or maintain gimple
insn chain in simplified form (as most optimizers seem to do) and then
proper trick is probably to fold during gimplification.
Ideas?
Honza
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-cfg.c,v
retrieving revision 1.1.4.193
diff -c -3 -p -r1.1.4.193 tree-cfg.c
*** tree-cfg.c 5 Nov 2003 13:39:23 -0000 1.1.4.193
--- tree-cfg.c 5 Nov 2003 15:12:12 -0000
*************** find_taken_edge (basic_block bb, tree va
*** 1845,1850 ****
--- 1862,1870 ----
abort ();
#endif
+ if (val)
+ val = fold (val);
+
/* If VAL is not a constant, we can't determine which edge might
be taken. */
if (val == NULL || !really_constant_p (val))