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: [i386 PATCH] Don't ICE on invalid %e0/%E0 operands (PR target/43638)


On Tue, Apr 6, 2010 at 11:00 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> All other print_operand codes that call put_condition_code have
> !COMPARISON_P checks, but these two don't. ?The following patch
> fixes it.
>
> The %eN/%EN modifiers have been added for jcc_fused_* in r136954
> which has been afterwards removed by r140514/PR37571. ?So another
> alternative would be to remove %e/%E support, I believe nothing
> else uses it. ?It would be a user visible change, perhaps somebody
> is using it in inline asm and we've shipped GCC 4.4 with that support
> already. ?Not sure what would anyone use it for, but given the bugreport
> at least someone tried to do that.
>
> Ok for 4.4/4.5? ?Or the alternative (removal of %e/%E support)?

Ok.

Thanks,
Richard.

> 2010-04-06 ?Jakub Jelinek ?<jakub@redhat.com>
>
> ? ? ? ?PR target/43638
> ? ? ? ?* config/i386/i386.c (print_operand): Report error if E or e operand
> ? ? ? ?is not a comparison.
>
> ? ? ? ?* gcc.target/i386/pr43638.c: New test.
>
> --- gcc/config/i386/i386.c.jj ? 2010-03-30 08:56:15.000000000 +0200
> +++ gcc/config/i386/i386.c ? ? ?2010-04-06 10:45:53.000000000 +0200
> @@ -11796,10 +11796,24 @@ print_operand (FILE *file, rtx x, int co
> ? ? ? ? ?return;
>
> ? ? ? ?case 'E':
> + ? ? ? ? if (!COMPARISON_P (x))
> + ? ? ? ? ? {
> + ? ? ? ? ? ? output_operand_lossage ("operand is neither a constant nor a "
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "condition code, invalid operand "
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "code 'E'");
> + ? ? ? ? ? ? return;
> + ? ? ? ? ? }
> ? ? ? ? ?put_condition_code (GET_CODE (x), CCmode, 0, 0, file);
> ? ? ? ? ?return;
>
> ? ? ? ?case 'e':
> + ? ? ? ? if (!COMPARISON_P (x))
> + ? ? ? ? ? {
> + ? ? ? ? ? ? output_operand_lossage ("operand is neither a constant nor a "
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "condition code, invalid operand "
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "code 'e'");
> + ? ? ? ? ? ? return;
> + ? ? ? ? ? }
> ? ? ? ? ?put_condition_code (GET_CODE (x), CCmode, 1, 0, file);
> ? ? ? ? ?return;
>
> --- gcc/testsuite/gcc.target/i386/pr43638.c.jj ?2010-04-06 10:50:31.000000000 +0200
> +++ gcc/testsuite/gcc.target/i386/pr43638.c ? ? 2010-04-06 10:51:11.000000000 +0200
> @@ -0,0 +1,9 @@
> +/* PR target/43638 */
> +/* { dg-do compile } */
> +
> +void
> +foo (void)
> +{
> + ?int x;
> + ?__asm __volatile ("mov $0,%e0" : "=r" (x)); ?/* { dg-error "invalid operand code" } */
> +}
>
> ? ? ? ?Jakub
>


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