This is the mail archive of the gcc-patches@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: ifcvt: cond_exec-like behavior on cc0 machines


On Jul 17, 2003, Alexandre Oliva <aoliva@redhat.com> wrote:

> I found out cond_exec can't contain cc0 in the condition, so I had to
> change my plans in regards to implementing conditional bit-set and
> bit-clear instructions on the port I'm working on.

rth asked me why on IRC, and asked me to post the details here, for
the list's benefit.

The reason is the init_propagate_block() block of code conditioned by
HAVE_conditional_execution.  Ports that use cc0 in conditions for
branches will crash here:

	  if (GET_CODE (reg) != REG)
	    abort ();

because reg is cc0.  Even if I try to canonicalize cond_true with
get_condition, to know the actual condition the branch is subject to,
it may still fail.  get_condition won't always be able to find the
condition, if cc0 is set by side effect by a previous instruction
(something that splitters, peepholes or maybe even expanders might
introduce), it fails, and then the conditional life tracking code
fails even earlier.

This pretty much rules out cond_exec in cc0-using machines, unless
this chunk of code is modified so as to work around the inability to
figure out the controlling condition of a branch, and any other
incompatibilities between cc0 and HAVE_conditional_execution that
might exist are fixed.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


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