This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patches to fix optimizer bug & C++ exceptions for GCC VAX backend
- From: "Maciej W. Rozycki" <macro at linux-mips dot org>
- To: Jake Hamby <jehamby420 at me dot com>
- Cc: Jan-Benedict Glaw <jbglaw at lug-owl dot de>, Christos Zoulas <christos at astron dot com>, port-vax at netbsd dot org, gcc-patches at gcc dot gnu dot org
- Date: Sat, 9 Apr 2016 12:49:44 +0100 (BST)
- Subject: Re: Patches to fix optimizer bug & C++ exceptions for GCC VAX backend
- Authentication-results: sourceware.org; auth=none
- References: <F48D0C6B-A6DB-410B-BC97-C30D4E8B4612 at me dot com> <ncu3pc$gkd$1 at ger dot gmane dot org> <DB0276A6-0A26-44F7-8FDC-D086EA40C709 at me dot com> <26D90386-F298-4EDD-A7D7-278F87DF3949 at me dot com> <64F034DF-BDB0-44F3-B4DB-937DEE2795E6 at me dot com> <009114AB-9D39-4A5B-9935-70C012855DB0 at me dot com> <244703AA-2698-41B6-824F-999E1BB61968 at me dot com> <46F08A58-7790-4D2E-8146-9E6B5A3930B0 at me dot com> <20160331143007 dot GL28138 at lug-owl dot de> <44A3B14F-0EA8-46F6-9D2B-C438FB6448DD at me dot com> <alpine dot LFD dot 2 dot 20 dot 1604020105020 dot 15981 at eddie dot linux-mips dot org> <0F931CBA-4B91-42EE-88D7-351BC484E60B at me dot com>
On Fri, 8 Apr 2016, Jake Hamby wrote:
> Thanks for the info! I've discovered a few additional clues which should
> help, namely the optimizer pass that's introducing the problem. Through
> process of elimination, I discovered that adding "-fno-tree-ter" will
> prevent the unrecognizable insn error. Strangely, I can't cause the
> problem by using "-ftree-ter" and -O0, which seems odd, unless the code
> is checking directly for a -O flag.
You can't turn most optimisations on at -O0, you need to globally enable
optimisation in the first place -- any -O setting will do, e.g. -O, -Os,
etc., as per the GCC manual:
"Most optimizations are only enabled if an `-O' level is set on the
command line. Otherwise they are disabled, even if individual
optimization flags are specified."
So to enable a single optimisation only you'll have to use e.g. -O
combined with a list of negated -f options to disable this level's
optimisation defaults. Yes, I agree this sounds like an awkward UI; I
guess it dates back to GCC's early days and nobody bothered to fix it.
Maybe we need -Onone or suchlike.
> I'll continue to clean up the diffs that I've been working on, and send
> out something when I've made more progress. I like the "cc" attr code
> that I've added to fix the overaggressive elimination of CC0 tests, but
> the problem is that now it's too conservative, because many insns are
> defined as calls into C code which may or may not generate insns that
> set the condition codes. I have a few ideas on how to clean up and
> refactor that code, but first I had to convince myself that most of
> what's in there now are actually useful optimizations, and they seem to
> be.
Good luck!
> Thanks for the help!
You are welcome!
Maciej