This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH: PR target/41705] Enable if conversion for thumb1 by new HAVE_conditional_execution definition
Carrot Wei <carrot@google.com> writes:
> Current method in genconfig.c is looking for COND_EXEC expression. I've
> grepped several targets, there are several cases have cond_exec but no
> define_cond_exec. So use define_cond_exec may change their behavior.
I agree that those targets should not be changed.
Would it be possible for genconfig to simply || together the various
predicates for the various cond_exec insns?
> Can we change the output of genconfig.c to
>
> #ifndef HAVE_conditional_execution
> #define HAVE_conditional_execution 1
> #endif
>
> So we can use customized version of HAVE_conditional_execution defined
> in the target specific header file if we want. Otherwise genconfig.c will
> generate one according to the contents of md file.
No, I don't think that is a good idea. Nothing else in gcc works that
way, and I see nothing to recommend it. Don't think "how can I solve
this problem today for me." Think "how can I solve this for all time
for all targets in a way that is easy to maintain."
>> The quick solution would be to introduce a new target hook and change
>> every place that checks HAVE_conditional_execution to check that.
>
> I'm afraid simply replacing all HAVE_conditional_execution with new target hook
> may break other targets have HAVE_conditional_execution enabled.
Just make the default value for the target hook return
HAVE_conditional_execution.
Ian