public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* CDImode in reg
@ 2011-10-04  9:33 Aurelien Buhrig
  2011-10-04 14:07 ` Ian Lance Taylor
  0 siblings, 1 reply; 9+ messages in thread
From: Aurelien Buhrig @ 2011-10-04  9:33 UTC (permalink / raw)
  To: gcc-help

Hi,

I'm trying to get the gcc testsuite passing for my new target port.
The last ICE deals with complex long long (gcc.c-torture/compile/20000804-1.c).
My target has 16-bit wide int, and regs can hold DImode max.

code:

  __complex__ long long v;
  asm("": "+r" (v) : "r" (0), "r" (1));

Is such the testcase an expected fail or not ?
Operations on complex are often split into DI operations. But the
target cannot hold a whole CDI into one register, but could hold 2 DI
into 2 distinct DI regs.

If it is an xfail, is there a way handle such a case at higher level
to prevent an ICE and generate a more user friendly error message ?

If it is a fail, I have no idea how to fix this (pb with
init_move_cost(CDImode), with a gcc_assert
(have_regs_of_mode[CDImode]))

Thanks,
Aurélien

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CDImode in reg
  2011-10-04  9:33 CDImode in reg Aurelien Buhrig
@ 2011-10-04 14:07 ` Ian Lance Taylor
  2011-10-04 14:53   ` Aurelien Buhrig
  0 siblings, 1 reply; 9+ messages in thread
From: Ian Lance Taylor @ 2011-10-04 14:07 UTC (permalink / raw)
  To: Aurelien Buhrig; +Cc: gcc-help

Aurelien Buhrig <aurelien.buhrig.gcc@gmail.com> writes:

> I'm trying to get the gcc testsuite passing for my new target port.
> The last ICE deals with complex long long (gcc.c-torture/compile/20000804-1.c).

As you can see from the test file, several targets skip this test using
dg-skip-if.

Ian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CDImode in reg
  2011-10-04 14:07 ` Ian Lance Taylor
@ 2011-10-04 14:53   ` Aurelien Buhrig
  2011-10-04 15:52     ` Segher Boessenkool
  2011-10-04 16:19     ` Ian Lance Taylor
  0 siblings, 2 replies; 9+ messages in thread
From: Aurelien Buhrig @ 2011-10-04 14:53 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

So it should be skipped and the ICE is the normal behavior for such
irrelevant test cases ?

Thanks for your help,
Aurélien


2011/10/4 Ian Lance Taylor <iant@google.com>:
> Aurelien Buhrig <aurelien.buhrig.gcc@gmail.com> writes:
>
>> I'm trying to get the gcc testsuite passing for my new target port.
>> The last ICE deals with complex long long (gcc.c-torture/compile/20000804-1.c).
>
> As you can see from the test file, several targets skip this test using
> dg-skip-if.
>
> Ian
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CDImode in reg
  2011-10-04 14:53   ` Aurelien Buhrig
@ 2011-10-04 15:52     ` Segher Boessenkool
  2011-10-04 16:19     ` Ian Lance Taylor
  1 sibling, 0 replies; 9+ messages in thread
From: Segher Boessenkool @ 2011-10-04 15:52 UTC (permalink / raw)
  To: Aurelien Buhrig; +Cc: Ian Lance Taylor, gcc-help

> So it should be skipped and the ICE is the normal behavior for such
> irrelevant test cases ?

It should be skipped, but no input should ICE the compiler.


Segher

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CDImode in reg
  2011-10-04 14:53   ` Aurelien Buhrig
  2011-10-04 15:52     ` Segher Boessenkool
@ 2011-10-04 16:19     ` Ian Lance Taylor
  2011-10-04 17:00       ` Aurelien Buhrig
  1 sibling, 1 reply; 9+ messages in thread
From: Ian Lance Taylor @ 2011-10-04 16:19 UTC (permalink / raw)
  To: Aurelien Buhrig; +Cc: gcc-help

Aurelien Buhrig <aurelien.buhrig.gcc@gmail.com> writes:

> So it should be skipped and the ICE is the normal behavior for such
> irrelevant test cases ?

Personally, I don't really think an ICE is ever an acceptable result
from the compiler.  However, there are practical considerations.  Nobody
is ever going to write code like that for your processor.  If gets an
ICE, no real programmer is ever going to notice.  And if it didn't get
an ICE it would get an error instead.  So it's really up to you how much
effort you want to put in to generating a proper error message rather
than an ICE.

Ian


> 2011/10/4 Ian Lance Taylor <iant@google.com>:
>> Aurelien Buhrig <aurelien.buhrig.gcc@gmail.com> writes:
>>
>>> I'm trying to get the gcc testsuite passing for my new target port.
>>> The last ICE deals with complex long long (gcc.c-torture/compile/20000804-1.c).
>>
>> As you can see from the test file, several targets skip this test using
>> dg-skip-if.
>>
>> Ian
>>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CDImode in reg
  2011-10-04 16:19     ` Ian Lance Taylor
@ 2011-10-04 17:00       ` Aurelien Buhrig
  2011-10-04 18:22         ` Ian Lance Taylor
  0 siblings, 1 reply; 9+ messages in thread
From: Aurelien Buhrig @ 2011-10-04 17:00 UTC (permalink / raw)
  To: Ian Lance Taylor, segher; +Cc: gcc-help

>> So it should be skipped and the ICE is the normal behavior for such
>> irrelevant test cases ?
>
> Personally, I don't really think an ICE is ever an acceptable result
> from the compiler.  However, there are practical considerations.  Nobody
> is ever going to write code like that for your processor.  If gets an
> ICE, no real programmer is ever going to notice.  And if it didn't get
> an ICE it would get an error instead.  So it's really up to you how much
> effort you want to put in to generating a proper error message rather
> than an ICE.

I agree. BTW, I wonder how I could handle such an ICE from my backend
if I wanted to.

Thanks
Aurélien

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CDImode in reg
  2011-10-04 17:00       ` Aurelien Buhrig
@ 2011-10-04 18:22         ` Ian Lance Taylor
  2011-10-05  7:31           ` Aurelien Buhrig
  0 siblings, 1 reply; 9+ messages in thread
From: Ian Lance Taylor @ 2011-10-04 18:22 UTC (permalink / raw)
  To: Aurelien Buhrig; +Cc: segher, gcc-help

Aurelien Buhrig <aurelien.buhrig.gcc@gmail.com> writes:

>>> So it should be skipped and the ICE is the normal behavior for such
>>> irrelevant test cases ?
>>
>> Personally, I don't really think an ICE is ever an acceptable result
>> from the compiler.  However, there are practical considerations.  Nobody
>> is ever going to write code like that for your processor.  If gets an
>> ICE, no real programmer is ever going to notice.  And if it didn't get
>> an ICE it would get an error instead.  So it's really up to you how much
>> effort you want to put in to generating a proper error message rather
>> than an ICE.
>
> I agree. BTW, I wonder how I could handle such an ICE from my backend
> if I wanted to.

I don't know--I don't know exactly what is causing the ICE.

Ian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CDImode in reg
  2011-10-04 18:22         ` Ian Lance Taylor
@ 2011-10-05  7:31           ` Aurelien Buhrig
  2011-10-05 13:55             ` Ian Lance Taylor
  0 siblings, 1 reply; 9+ messages in thread
From: Aurelien Buhrig @ 2011-10-05  7:31 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

The ICE is caused by a gcc_assert(have_regs_of_mode[CDImode])) in
init_move_cost(CDImode)...

Aurélien
2011/10/4 Ian Lance Taylor <iant@google.com>:
> Aurelien Buhrig <aurelien.buhrig.gcc@gmail.com> writes:
>
>>>> So it should be skipped and the ICE is the normal behavior for such
>>>> irrelevant test cases ?
>>>
>>> Personally, I don't really think an ICE is ever an acceptable result
>>> from the compiler.  However, there are practical considerations.  Nobody
>>> is ever going to write code like that for your processor.  If gets an
>>> ICE, no real programmer is ever going to notice.  And if it didn't get
>>> an ICE it would get an error instead.  So it's really up to you how much
>>> effort you want to put in to generating a proper error message rather
>>> than an ICE.
>>
>> I agree. BTW, I wonder how I could handle such an ICE from my backend
>> if I wanted to.
>
> I don't know--I don't know exactly what is causing the ICE.
>
> Ian
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CDImode in reg
  2011-10-05  7:31           ` Aurelien Buhrig
@ 2011-10-05 13:55             ` Ian Lance Taylor
  0 siblings, 0 replies; 9+ messages in thread
From: Ian Lance Taylor @ 2011-10-05 13:55 UTC (permalink / raw)
  To: Aurelien Buhrig; +Cc: gcc-help

Aurelien Buhrig <aurelien.buhrig.gcc@gmail.com> writes:

> The ICE is caused by a gcc_assert(have_regs_of_mode[CDImode])) in
> init_move_cost(CDImode)...

Sounds like IRA needs to check have_regs_of_mode itself and give a
better error message when using an asm instruction.  I doubt this can be
fixed strictly in your backend.

Ian

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-10-05 13:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-04  9:33 CDImode in reg Aurelien Buhrig
2011-10-04 14:07 ` Ian Lance Taylor
2011-10-04 14:53   ` Aurelien Buhrig
2011-10-04 15:52     ` Segher Boessenkool
2011-10-04 16:19     ` Ian Lance Taylor
2011-10-04 17:00       ` Aurelien Buhrig
2011-10-04 18:22         ` Ian Lance Taylor
2011-10-05  7:31           ` Aurelien Buhrig
2011-10-05 13:55             ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).