public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug inline-asm/31768]  New: Invalid code or ICE for %z constraint
@ 2007-04-30 22:03 us15 at os dot inf dot tu-dresden dot de
  2007-05-03 14:32 ` [Bug inline-asm/31768] " uros at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: us15 at os dot inf dot tu-dresden dot de @ 2007-04-30 22:03 UTC (permalink / raw)
  To: gcc-bugs

The following code should generate outb, outw and outl statements.

gcc-3.4.6 produces an ICE:
foo.cc: In function `void out(unsigned int, T) [with T = unsigned char]':
foo.cc:14:   instantiated from here
foo.cc:5: internal compiler error: in print_operand, at config/i386/i386.c:7375

gcc-4.1.2 produces an ICE:
foo.cc: In function 'void out(unsigned int, T) [with T = unsigned char]':
foo.cc:5: internal compiler error: in print_operand, at config/i386/i386.c:7226

gcc-4.3.0 generates wrong code (outs instead of outw) for T=unsigned short 
foo.cc: Assembler messages:
foo.cc:5: Error: suffix or operands invalid for `outs'

Code snippet:

template <typename T>
static inline void
out (unsigned port, T val)
{
    asm volatile ("out%z0 %0, %w1" : : "a" (val), "Nd" (port));
}

int main()
{
    unsigned char a; 
    unsigned short b;
    unsigned long c;

    out (0x80, a);
    out (0x80, b);
    out (0x80, c);
}


-- 
           Summary: Invalid code or ICE for %z constraint
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: inline-asm
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: us15 at os dot inf dot tu-dresden dot de


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


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

end of thread, other threads:[~2007-05-03 16:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-30 22:03 [Bug inline-asm/31768] New: Invalid code or ICE for %z constraint us15 at os dot inf dot tu-dresden dot de
2007-05-03 14:32 ` [Bug inline-asm/31768] " uros at gcc dot gnu dot org
2007-05-03 14:41 ` [Bug target/31768] " ubizjak at gmail dot com
2007-05-03 15:22 ` us15 at os dot inf dot tu-dresden dot de
2007-05-03 16:38 ` ubizjak at gmail dot com

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