Message ID | 000001cff363$0322adf0$096809d0$@arm.com |
---|---|
State | New |
Headers | show |
On 10/29/2014 03:27 AM, Zhenqiang Chen wrote: > > ChangeLog: > 2014-10-29 Zhenqiang Chen <zhenqiang.chen@arm.com> > > * ifcvt.c (noce_emit_cmove, noce_get_alt_condition, > noce_get_condition): > Allow CC mode if HAVE_cbranchcc4. Ok. r~
On Wed, 2014-10-29 18:27:57 +0800, Zhenqiang Chen <zhenqiang.chen@arm.com> wrote: > Hi, > > The patch enhances ifcvt to allow_cc_mode if HAVE_cbranchcc4. > > Bootstrap and no make check regression on X86-64. > Will add new test cases after ccmp is enabled. > > Ok for trunk? This seems to uncover something for s390x-linux, see http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=372394 [...] g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -I. -I. -I/home/jbglaw/repos/gcc/gcc -I/home/jbglaw/repos/gcc/gcc/. -I/home/jbglaw/repos/gcc/gcc/../include -I/home/jbglaw/repos/gcc/gcc/../libcpp/include -I/home/jbglaw/repos/gcc/gcc/../libdecnumber -I/home/jbglaw/repos/gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I/home/jbglaw/repos/gcc/gcc/../libbacktrace -o ifcvt.o -MT ifcvt.o -MMD -MP -MF ./.deps/ifcvt.TPo /home/jbglaw/repos/gcc/gcc/ifcvt.c /home/jbglaw/repos/gcc/gcc/ifcvt.c:1456:5: error: token "." is not valid in preprocessor expressions /home/jbglaw/repos/gcc/gcc/ifcvt.c:1788:5: error: token "." is not valid in preprocessor expressions /home/jbglaw/repos/gcc/gcc/ifcvt.c:2370:5: error: token "." is not valid in preprocessor expressions make[1]: *** [ifcvt.o] Error 1 It's choking on the HAVE_cbranchcc4 macro itself there. MfG, JBG
On Mon, Nov 03, 2014 at 11:06:06AM +0100, Jan-Benedict Glaw wrote: > On Wed, 2014-10-29 18:27:57 +0800, Zhenqiang Chen <zhenqiang.chen@arm.com> wrote: > > Hi, > > > > The patch enhances ifcvt to allow_cc_mode if HAVE_cbranchcc4. > > > > Bootstrap and no make check regression on X86-64. > > Will add new test cases after ccmp is enabled. > > > > Ok for trunk? > > This seems to uncover something for s390x-linux, see > http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=372394 > > [...] > g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -I. -I. -I/home/jbglaw/repos/gcc/gcc -I/home/jbglaw/repos/gcc/gcc/. -I/home/jbglaw/repos/gcc/gcc/../include -I/home/jbglaw/repos/gcc/gcc/../libcpp/include -I/home/jbglaw/repos/gcc/gcc/../libdecnumber -I/home/jbglaw/repos/gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I/home/jbglaw/repos/gcc/gcc/../libbacktrace -o ifcvt.o -MT ifcvt.o -MMD -MP -MF ./.deps/ifcvt.TPo /home/jbglaw/repos/gcc/gcc/ifcvt.c > /home/jbglaw/repos/gcc/gcc/ifcvt.c:1456:5: error: token "." is not valid in preprocessor expressions > /home/jbglaw/repos/gcc/gcc/ifcvt.c:1788:5: error: token "." is not valid in preprocessor expressions > /home/jbglaw/repos/gcc/gcc/ifcvt.c:2370:5: error: token "." is not valid in preprocessor expressions > make[1]: *** [ifcvt.o] Error 1 > > It's choking on the HAVE_cbranchcc4 macro itself there. Note the HAVE_* macros can be not defined, or defined to complex expressions (for the conditions), not necessarily compile time constants. At the start of ifcvt.c there is: #ifndef HAVE_conditional_move #define HAVE_conditional_move 0 #endif #ifndef HAVE_incscc #define HAVE_incscc 0 #endif #ifndef HAVE_decscc #define HAVE_decscc 0 #endif #ifndef HAVE_trap #define HAVE_trap 0 #endif so supposedly HAVE_cbranchcc4 should be treated similarly, and all the #if HAVE_cbranchcc4 code actually replaced with if (HAVE_cbranchcc4) #instead. Jakub
"Zhenqiang Chen" <zhenqiang.chen@arm.com> writes: > diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c > index a28f5c1..5cd0ac0 100644 > --- a/gcc/ifcvt.c > +++ b/gcc/ifcvt.c > @@ -1441,10 +1441,17 @@ noce_emit_cmove (struct noce_if_info *if_info, rtx > x, enum rtx_code code, > end_sequence (); > } > > - /* Don't even try if the comparison operands are weird. */ > + /* Don't even try if the comparison operands are weird > + except that the target supports cbranchcc4. */ > if (! general_operand (cmp_a, GET_MODE (cmp_a)) > || ! general_operand (cmp_b, GET_MODE (cmp_b))) > - return NULL_RTX; > + { > +#if HAVE_cbranchcc4 You need to make that a runtime check. #ifdef HAVE_cbranchcc4 if (HAVE_cbranchcc4) Andreas.
On Mon, 2014-11-03 11:06:06 +0100, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote: > On Wed, 2014-10-29 18:27:57 +0800, Zhenqiang Chen <zhenqiang.chen@arm.com> wrote: > > Hi, > > > > The patch enhances ifcvt to allow_cc_mode if HAVE_cbranchcc4. > > > > Bootstrap and no make check regression on X86-64. > > Will add new test cases after ccmp is enabled. > > > > Ok for trunk? > > This seems to uncover something for s390x-linux, see > http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=372394 > > [...] > g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -I. -I. -I/home/jbglaw/repos/gcc/gcc -I/home/jbglaw/repos/gcc/gcc/. -I/home/jbglaw/repos/gcc/gcc/../include -I/home/jbglaw/repos/gcc/gcc/../libcpp/include -I/home/jbglaw/repos/gcc/gcc/../libdecnumber -I/home/jbglaw/repos/gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I/home/jbglaw/repos/gcc/gcc/../libbacktrace -o ifcvt.o -MT ifcvt.o -MMD -MP -MF ./.deps/ifcvt.TPo /home/jbglaw/repos/gcc/gcc/ifcvt.c > /home/jbglaw/repos/gcc/gcc/ifcvt.c:1456:5: error: token "." is not valid in preprocessor expressions > /home/jbglaw/repos/gcc/gcc/ifcvt.c:1788:5: error: token "." is not valid in preprocessor expressions > /home/jbglaw/repos/gcc/gcc/ifcvt.c:2370:5: error: token "." is not valid in preprocessor expressions > make[1]: *** [ifcvt.o] Error 1 > > It's choking on the HAVE_cbranchcc4 macro itself there. Oh, and with the most recent ifcvt.c changes, this boils down to: g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../../gcc/gcc -I../../../gcc/gcc/. -I../../../gcc/gcc/../include -I../../../gcc/gcc/../libcpp/include -I/opt/cfarm/mpc/include -I../../../gcc/gcc/../libdecnumber -I../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../../gcc/gcc/../libbacktrace -o ifcvt.o -MT ifcvt.o -MMD -MP -MF ./.deps/ifcvt.TPo ../../../gcc/gcc/ifcvt.c In file included from ./tm.h:19:0, from ../../../gcc/gcc/ifcvt.c:23: ./options.h:263:36: error: token "." is not valid in preprocessor expressions #define target_flags global_options.x_target_flags ^ ./options.h:4276:29: note: in expansion of macro ‘target_flags’ #define TARGET_HARD_FLOAT ((target_flags & MASK_SOFT_FLOAT) == 0) ^ ./insn-flags.h:439:26: note: in expansion of macro ‘TARGET_HARD_FLOAT’ #define HAVE_cbranchcc4 (TARGET_HARD_FLOAT) ^ ../../../gcc/gcc/ifcvt.c:1467:5: note: in expansion of macro ‘HAVE_cbranchcc4’ #if HAVE_cbranchcc4 ^ ./options.h:263:36: error: token "." is not valid in preprocessor expressions #define target_flags global_options.x_target_flags ^ ./options.h:4276:29: note: in expansion of macro ‘target_flags’ #define TARGET_HARD_FLOAT ((target_flags & MASK_SOFT_FLOAT) == 0) ^ ./insn-flags.h:439:26: note: in expansion of macro ‘TARGET_HARD_FLOAT’ #define HAVE_cbranchcc4 (TARGET_HARD_FLOAT) ^ ../../../gcc/gcc/ifcvt.c:1799:5: note: in expansion of macro ‘HAVE_cbranchcc4’ #if HAVE_cbranchcc4 ^ ./options.h:263:36: error: token "." is not valid in preprocessor expressions #define target_flags global_options.x_target_flags ^ ./options.h:4276:29: note: in expansion of macro ‘target_flags’ #define TARGET_HARD_FLOAT ((target_flags & MASK_SOFT_FLOAT) == 0) ^ ./insn-flags.h:439:26: note: in expansion of macro ‘TARGET_HARD_FLOAT’ #define HAVE_cbranchcc4 (TARGET_HARD_FLOAT) ^ ../../../gcc/gcc/ifcvt.c:2381:5: note: in expansion of macro ‘HAVE_cbranchcc4’ #if HAVE_cbranchcc4 ^ make[2]: *** [ifcvt.o] Error 1 (See build http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=372420 for reference.) MfG, JBG
> -----Original Message----- > From: Jan-Benedict Glaw [mailto:jbglaw@lug-owl.de] > Sent: Monday, November 03, 2014 6:16 PM > To: Zhenqiang Chen; Hartmut Penner; Ulrich Weigand; Andreas Krebbel > Cc: 'Richard Henderson'; gcc-patches@gcc.gnu.org > Subject: Re: [BUILDROBOT] s390x-linux: Breaking in ifcvt.c (was: [PATCH, ifcvt] > Allow CC mode if HAVE_cbranchcc4) > > On Mon, 2014-11-03 11:06:06 +0100, Jan-Benedict Glaw <jbglaw@lug-owl.de> > wrote: > > On Wed, 2014-10-29 18:27:57 +0800, Zhenqiang Chen > <zhenqiang.chen@arm.com> wrote: > > > Hi, > > > > > > The patch enhances ifcvt to allow_cc_mode if HAVE_cbranchcc4. > > > > > > Bootstrap and no make check regression on X86-64. > > > Will add new test cases after ccmp is enabled. > > > > > > Ok for trunk? > > > > This seems to uncover something for s390x-linux, see > > http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=372394 > > > > [...] > > g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno- > exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings > -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic - > Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common > -DHAVE_CONFIG_H -I. -I. -I/home/jbglaw/repos/gcc/gcc - > I/home/jbglaw/repos/gcc/gcc/. -I/home/jbglaw/repos/gcc/gcc/../include - > I/home/jbglaw/repos/gcc/gcc/../libcpp/include - > I/home/jbglaw/repos/gcc/gcc/../libdecnumber - > I/home/jbglaw/repos/gcc/gcc/../libdecnumber/dpd -I../libdecnumber - > I/home/jbglaw/repos/gcc/gcc/../libbacktrace -o ifcvt.o -MT ifcvt.o -MMD - > MP -MF ./.deps/ifcvt.TPo /home/jbglaw/repos/gcc/gcc/ifcvt.c > > /home/jbglaw/repos/gcc/gcc/ifcvt.c:1456:5: error: token "." is not > > valid in preprocessor expressions > > /home/jbglaw/repos/gcc/gcc/ifcvt.c:1788:5: error: token "." is not > > valid in preprocessor expressions > > /home/jbglaw/repos/gcc/gcc/ifcvt.c:2370:5: error: token "." is not > > valid in preprocessor expressions > > make[1]: *** [ifcvt.o] Error 1 > > > > It's choking on the HAVE_cbranchcc4 macro itself there. > > Oh, and with the most recent ifcvt.c changes, this boils down to: > > g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions > -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite- > strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual - > pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings - > Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../../gcc/gcc - > I../../../gcc/gcc/. -I../../../gcc/gcc/../include -I../../../gcc/gcc/../libcpp/include > -I/opt/cfarm/mpc/include -I../../../gcc/gcc/../libdecnumber - > I../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber - > I../../../gcc/gcc/../libbacktrace -o ifcvt.o -MT ifcvt.o -MMD -MP - > MF ./.deps/ifcvt.TPo ../../../gcc/gcc/ifcvt.c > In file included from ./tm.h:19:0, > from ../../../gcc/gcc/ifcvt.c:23: > ./options.h:263:36: error: token "." is not valid in preprocessor expressions > #define target_flags global_options.x_target_flags > ^ > ./options.h:4276:29: note: in expansion of macro ‘target_flags’ > #define TARGET_HARD_FLOAT ((target_flags & MASK_SOFT_FLOAT) == 0) > ^ > ./insn-flags.h:439:26: note: in expansion of macro ‘TARGET_HARD_FLOAT’ > #define HAVE_cbranchcc4 (TARGET_HARD_FLOAT) > ^ > ../../../gcc/gcc/ifcvt.c:1467:5: note: in expansion of macro ‘HAVE_cbranchcc4’ > #if HAVE_cbranchcc4 > ^ > ./options.h:263:36: error: token "." is not valid in preprocessor expressions > #define target_flags global_options.x_target_flags > ^ > ./options.h:4276:29: note: in expansion of macro ‘target_flags’ > #define TARGET_HARD_FLOAT ((target_flags & MASK_SOFT_FLOAT) == 0) > ^ > ./insn-flags.h:439:26: note: in expansion of macro ‘TARGET_HARD_FLOAT’ > #define HAVE_cbranchcc4 (TARGET_HARD_FLOAT) > ^ > ../../../gcc/gcc/ifcvt.c:1799:5: note: in expansion of macro ‘HAVE_cbranchcc4’ > #if HAVE_cbranchcc4 > ^ > ./options.h:263:36: error: token "." is not valid in preprocessor expressions > #define target_flags global_options.x_target_flags > ^ > ./options.h:4276:29: note: in expansion of macro ‘target_flags’ > #define TARGET_HARD_FLOAT ((target_flags & MASK_SOFT_FLOAT) == 0) > ^ > ./insn-flags.h:439:26: note: in expansion of macro ‘TARGET_HARD_FLOAT’ > #define HAVE_cbranchcc4 (TARGET_HARD_FLOAT) > ^ > ../../../gcc/gcc/ifcvt.c:2381:5: note: in expansion of macro ‘HAVE_cbranchcc4’ > #if HAVE_cbranchcc4 > ^ > make[2]: *** [ifcvt.o] Error 1 > > > > (See build > http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=372420 > for reference.) > > MfG, JBG > > -- > Jan-Benedict Glaw jbglaw@lug-owl.de +49-172-7608481 > Signature of: ...und wenn Du denkst, es geht nicht mehr, > the second : kommt irgendwo ein Lichtlein her.
Sorry for breaking the build. The patch was reverted. I will rework on it. Thanks! -Zhenqiang > -----Original Message----- > From: Jan-Benedict Glaw [mailto:jbglaw@lug-owl.de] > Sent: Monday, November 03, 2014 6:16 PM > To: Zhenqiang Chen; Hartmut Penner; Ulrich Weigand; Andreas Krebbel > Cc: 'Richard Henderson'; gcc-patches@gcc.gnu.org > Subject: Re: [BUILDROBOT] s390x-linux: Breaking in ifcvt.c (was: [PATCH, ifcvt] > Allow CC mode if HAVE_cbranchcc4) > > On Mon, 2014-11-03 11:06:06 +0100, Jan-Benedict Glaw <jbglaw@lug-owl.de> > wrote: > > On Wed, 2014-10-29 18:27:57 +0800, Zhenqiang Chen > <zhenqiang.chen@arm.com> wrote: > > > Hi, > > > > > > The patch enhances ifcvt to allow_cc_mode if HAVE_cbranchcc4. > > > > > > Bootstrap and no make check regression on X86-64. > > > Will add new test cases after ccmp is enabled. > > > > > > Ok for trunk? > > > > This seems to uncover something for s390x-linux, see > > http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=372394 > > > > [...] > > g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno- > exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings > -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic - > Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common > -DHAVE_CONFIG_H -I. -I. -I/home/jbglaw/repos/gcc/gcc - > I/home/jbglaw/repos/gcc/gcc/. -I/home/jbglaw/repos/gcc/gcc/../include - > I/home/jbglaw/repos/gcc/gcc/../libcpp/include - > I/home/jbglaw/repos/gcc/gcc/../libdecnumber - > I/home/jbglaw/repos/gcc/gcc/../libdecnumber/dpd -I../libdecnumber - > I/home/jbglaw/repos/gcc/gcc/../libbacktrace -o ifcvt.o -MT ifcvt.o -MMD - > MP -MF ./.deps/ifcvt.TPo /home/jbglaw/repos/gcc/gcc/ifcvt.c > > /home/jbglaw/repos/gcc/gcc/ifcvt.c:1456:5: error: token "." is not > > valid in preprocessor expressions > > /home/jbglaw/repos/gcc/gcc/ifcvt.c:1788:5: error: token "." is not > > valid in preprocessor expressions > > /home/jbglaw/repos/gcc/gcc/ifcvt.c:2370:5: error: token "." is not > > valid in preprocessor expressions > > make[1]: *** [ifcvt.o] Error 1 > > > > It's choking on the HAVE_cbranchcc4 macro itself there. > > Oh, and with the most recent ifcvt.c changes, this boils down to: > > g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions > -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite- > strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual - > pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings - > Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../../gcc/gcc - > I../../../gcc/gcc/. -I../../../gcc/gcc/../include -I../../../gcc/gcc/../libcpp/include > -I/opt/cfarm/mpc/include -I../../../gcc/gcc/../libdecnumber - > I../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber - > I../../../gcc/gcc/../libbacktrace -o ifcvt.o -MT ifcvt.o -MMD -MP - > MF ./.deps/ifcvt.TPo ../../../gcc/gcc/ifcvt.c > In file included from ./tm.h:19:0, > from ../../../gcc/gcc/ifcvt.c:23: > ./options.h:263:36: error: token "." is not valid in preprocessor expressions > #define target_flags global_options.x_target_flags > ^ > ./options.h:4276:29: note: in expansion of macro ‘target_flags’ > #define TARGET_HARD_FLOAT ((target_flags & MASK_SOFT_FLOAT) == 0) > ^ > ./insn-flags.h:439:26: note: in expansion of macro ‘TARGET_HARD_FLOAT’ > #define HAVE_cbranchcc4 (TARGET_HARD_FLOAT) > ^ > ../../../gcc/gcc/ifcvt.c:1467:5: note: in expansion of macro ‘HAVE_cbranchcc4’ > #if HAVE_cbranchcc4 > ^ > ./options.h:263:36: error: token "." is not valid in preprocessor expressions > #define target_flags global_options.x_target_flags > ^ > ./options.h:4276:29: note: in expansion of macro ‘target_flags’ > #define TARGET_HARD_FLOAT ((target_flags & MASK_SOFT_FLOAT) == 0) > ^ > ./insn-flags.h:439:26: note: in expansion of macro ‘TARGET_HARD_FLOAT’ > #define HAVE_cbranchcc4 (TARGET_HARD_FLOAT) > ^ > ../../../gcc/gcc/ifcvt.c:1799:5: note: in expansion of macro ‘HAVE_cbranchcc4’ > #if HAVE_cbranchcc4 > ^ > ./options.h:263:36: error: token "." is not valid in preprocessor expressions > #define target_flags global_options.x_target_flags > ^ > ./options.h:4276:29: note: in expansion of macro ‘target_flags’ > #define TARGET_HARD_FLOAT ((target_flags & MASK_SOFT_FLOAT) == 0) > ^ > ./insn-flags.h:439:26: note: in expansion of macro ‘TARGET_HARD_FLOAT’ > #define HAVE_cbranchcc4 (TARGET_HARD_FLOAT) > ^ > ../../../gcc/gcc/ifcvt.c:2381:5: note: in expansion of macro ‘HAVE_cbranchcc4’ > #if HAVE_cbranchcc4 > ^ > make[2]: *** [ifcvt.o] Error 1 > > > > (See build > http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=372420 > for reference.) > > MfG, JBG > > -- > Jan-Benedict Glaw jbglaw@lug-owl.de +49-172-7608481 > Signature of: ...und wenn Du denkst, es geht nicht mehr, > the second : kommt irgendwo ein Lichtlein her.
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index a28f5c1..5cd0ac0 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -1441,10 +1441,17 @@ noce_emit_cmove (struct noce_if_info *if_info, rtx x, enum rtx_code code, end_sequence (); } - /* Don't even try if the comparison operands are weird. */ + /* Don't even try if the comparison operands are weird + except that the target supports cbranchcc4. */ if (! general_operand (cmp_a, GET_MODE (cmp_a)) || ! general_operand (cmp_b, GET_MODE (cmp_b))) - return NULL_RTX; + { +#if HAVE_cbranchcc4 + if (GET_MODE_CLASS (GET_MODE (cmp_a)) != MODE_CC + || cmp_b != const0_rtx) +#endif + return NULL_RTX; + } #if HAVE_conditional_move