This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: More embarrassing failures to optimize
- From: Zack Weinberg <zack at codesourcery dot com>
- To: martin at xemacs dot org
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 05 Jan 2003 10:40:48 -0800
- Subject: Re: More embarrassing failures to optimize
- References: <15895.61324.872456.502039@wobble.local>
Martin Buchholz <martin@xemacs.org> writes:
> void f3 ()
> {
> Bool t (true), f (false);
>
> assert (t); assert (! f);
> assert (t); assert (! f);
> }
>
> is "optimized" to
>
> xorl %edx, %edx
> subl $12, %esp
> testb %dl, %dl
> jne .L52
> addl $12, %esp
> ret
> .L52:
> pushl $_ZZ2f3vE19__PRETTY_FUNCTION__
> pushl $42
> pushl $.LC0
> pushl $.LC2
> call __assert_fail
>
> Note that the resulting code contains exactly one branch, not two or
> four.
I suspect this is the same underlying problem that causes
gcc.c-torture/execute/builtin-constant.c to fail. This was discussed
at some length in the thread starting at
http://gcc.gnu.org/ml/gcc-patches/2002-11/msg00235.html - it's
nontrivial to fix.
You might want to try these embarrassing failures against the tree-ssa
branch.
zw