public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/13515] New: `asm' operand requires impossible reload
@ 2003-12-30 12:28 debian-gcc at lists dot debian dot org
  2003-12-30 18:34 ` [Bug target/13515] " pinskia at gcc dot gnu dot org
  2004-01-08  8:11 ` wilson at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: debian-gcc at lists dot debian dot org @ 2003-12-30 12:28 UTC (permalink / raw)
  To: gcc-bugs

[forwarded from http://bugs.debian.org/221291]

currently unable to recheck due to lack of ia64 hardware ...


Hello GCC maintainers,

On ia64, gcc fails to compile the following file

merulo% gcc test2.c
test2.c: In function `muluu':
test2.c:20: error: `asm' operand requires impossible reload

Compiling with -O, -O1,-O2 or -Os avoid the problem,
as does removing the `register' keyword line 18.

Since the build fail before the assembler is called, the code
in the asm statement is irrelevant, only the constraint are
important.

In fact a asm statement of
__asm__ ("": "=f" (hiremainder) );
or even
__asm__ ("": :"f" (hiremainder) );
would be sufficient to trigger the problem.

Cheers,
-- 
Bill. <ballombe@debian.org>

Imagine a large red swirl here. 

---test2.c--------
typedef unsigned long ulong;
typedef long *GEN;

#define mulll(a, b)                                                     \
({                                                                      \
  ulong __arg1 = (a), __arg2 = (b), __value;                            \
  __asm__ ("xma.hu %0 = %2, %3, f0\n\t;;\n\txma.l %1 = %2, %3, f0"      \
           : "=&f" (hiremainder), "=f" (__value)                        \
           : "f" (__arg1), "f" (__arg2));                               \
  __value;                                                              \
})

GEN
muluu(ulong x, ulong y)
{
  long p1;
  GEN z;
  register ulong hiremainder;

  p1 = mulll(x,y);
  if (hiremainder)
  {
    z[2]=hiremainder; z[3]=p1; return z;
  }
  z[2]=p1; return z;
}

-- 
           Summary: `asm' operand requires impossible reload
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: debian-gcc at lists dot debian dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: ia64-linux
  GCC host triplet: ia64-linux
GCC target triplet: ia64-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13515


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

* [Bug target/13515] `asm' operand requires impossible reload
  2003-12-30 12:28 [Bug target/13515] New: `asm' operand requires impossible reload debian-gcc at lists dot debian dot org
@ 2003-12-30 18:34 ` pinskia at gcc dot gnu dot org
  2004-01-08  8:11 ` wilson at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-30 18:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-30 18:11 -------
Weird, it works on ipl32 mode and lp64 mode.
Confirmed on the mainline.
You do not need ia64 hardware to recheck this.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
  GCC build triplet|ia64-linux                  |
   GCC host triplet|ia64-linux                  |
 GCC target triplet|ia64-linux                  |ia64-*
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2003-12-30 18:11:07
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13515


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

* [Bug target/13515] `asm' operand requires impossible reload
  2003-12-30 12:28 [Bug target/13515] New: `asm' operand requires impossible reload debian-gcc at lists dot debian dot org
  2003-12-30 18:34 ` [Bug target/13515] " pinskia at gcc dot gnu dot org
@ 2004-01-08  8:11 ` wilson at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: wilson at gcc dot gnu dot org @ 2004-01-08  8:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From wilson at gcc dot gnu dot org  2004-01-08 08:11 -------
The situation here is a little obscure.  reload_as_needed calls
constrain_operands during reload, to check whether insns emitted for asm reloads
are valid insns.  Since this is during reload, we need to accept unallocated
pseudos as memory operands, even though we are in strict mode. 
constrain_operands has support for this for the 'm' constraint.  The IA-64 port
however must define its own 'Q' constraint for FP load/stores, because there are
no volatile load/stores from FP registers.  And the problem here is that 'Q'
isn't accepting an unallocated psuedo when reload_in_progress is true.

The relatively new EXTRA_MEMORY_CONSTRAINT macro (Aug 2002) solves this problem.
 So all we need to do is define it for the IA-64 port.  We need different
patches for gcc-3.3 and mainline.  This is the mainline change
#define EXTRA_MEMORY_CONSTRAINT(C, STR) (C == 'Q' || C == 'S')
The 3.3 change is similar, but without the STR argument.

Unfortunately, when I try to bootstrap this, I get an ICE compiling
libjava/java/lang/s_rint.c.  The problem here is that we also get the check for
address_reloaded which bypasses the MEM_VOLATILE_P check that the 'Q' constraint
does.

To fix this, we need yet another macro that controls reload, which seems unwise,
or else we need a different approach, such as using secondary reloads, which
will be a bigger patch, and there is no guarantee that it will work either.

Since this is an obscure problem with an easy workaround, and the fix looks
involved, I am tabling it for now to work on more tractable problems instead.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13515


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

end of thread, other threads:[~2004-01-08  8:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-30 12:28 [Bug target/13515] New: `asm' operand requires impossible reload debian-gcc at lists dot debian dot org
2003-12-30 18:34 ` [Bug target/13515] " pinskia at gcc dot gnu dot org
2004-01-08  8:11 ` wilson at gcc dot gnu dot org

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).