This is the mail archive of the gcc@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]

Re: More embarrassing failures to optimize


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


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