This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa-branch] Thoughts about the simplifier langhook
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 26 Aug 2002 13:02:15 -0400
- Subject: [tree-ssa-branch] Thoughts about the simplifier langhook
- Organization: Red Hat Canada
The previous implementation called the simplifier langhook from
c-decl.c directly. This way, if a front-end didn't support
simplification, it would just return.
But now, we call a generic simplifier and the langhook is merely
used to help the generic code. We get into several problems with
Objective-C because the front-end thinks that it can simplify the
code, when it really can't. So now CCP is messing up just about
every other Objective C test because it's, inadvertently,
optimizing raw trees.
Thoughts on how to address this? I agree that the current design
is the way to go long term, but we need to have a short term
workaround to avoid messing up Objective-C (until someone steps
in and writes a simplifier for it).
Maybe we could have another langhook that tells us if it's OK to
simplify that language? I've now hacked simplify_function_tree
to return 0 if lang_hooks.simplify_expr == lhd_simplify_expr.
Atrocious, but it works and it doesn't seem much worse than
having a lang_hooks.can_simplify_p.
Diego.