public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/5000: volatile asm code fails in template class member functions
@ 2001-12-03 17:17 rodrigc
  0 siblings, 0 replies; 6+ messages in thread
From: rodrigc @ 2001-12-03 17:17 UTC (permalink / raw)
  To: gcc-bugs, gcc-gnats, gcc-prs, nobody, sethml

Synopsis: volatile asm code fails in template class member functions

State-Changed-From-To: open->analyzed
State-Changed-By: rodrigc
State-Changed-When: Mon Dec  3 17:17:36 2001
State-Changed-Why:
    Compiling your testcase with gcc 3.0 yielded the following
    compilation error:
    
    b.cc: In function `int main()':
    b.cc:5: invalid `asm': operand number missing after %-letter
    b.cc:5: invalid `asm': operand number missing after %-letter
    
    If I changed the __asm__ line in your code to:
    
       __asm__ __volatile__ ("movl %%eax,%%eax");    
    
    Then it compiled without problem.
    
    Please see http://www.linuxassembly.org for a good tutorial
    on the asm syntax.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=5000&database=gcc


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

* Re: c++/5000: volatile asm code fails in template class member functions
@ 2001-12-04  0:16 rodrigc
  0 siblings, 0 replies; 6+ messages in thread
From: rodrigc @ 2001-12-04  0:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/5000; it has been noted by GNATS.

From: rodrigc@gcc.gnu.org
To: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
  nobody@gcc.gnu.org, sethml@ofb.net
Cc:  
Subject: Re: c++/5000: volatile asm code fails in template class member functions
Date: 4 Dec 2001 08:06:16 -0000

 Synopsis: volatile asm code fails in template class member functions
 
 State-Changed-From-To: analyzed->closed
 State-Changed-By: rodrigc
 State-Changed-When: Tue Dec  4 00:06:16 2001
 State-Changed-Why:
     Not a bug, testcase is faulty, even though it may have
     compiled under older gcc versions.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=5000&database=gcc


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

* Re: c++/5000: volatile asm code fails in template class member functions
@ 2001-12-04  0:06 rodrigc
  0 siblings, 0 replies; 6+ messages in thread
From: rodrigc @ 2001-12-04  0:06 UTC (permalink / raw)
  To: gcc-bugs, gcc-gnats, gcc-prs, nobody, sethml

Synopsis: volatile asm code fails in template class member functions

State-Changed-From-To: analyzed->closed
State-Changed-By: rodrigc
State-Changed-When: Tue Dec  4 00:06:16 2001
State-Changed-Why:
    Not a bug, testcase is faulty, even though it may have
    compiled under older gcc versions.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=5000&database=gcc


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

* Re: c++/5000: volatile asm code fails in template class member functions
@ 2001-12-03 21:36 sethml
  0 siblings, 0 replies; 6+ messages in thread
From: sethml @ 2001-12-03 21:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/5000; it has been noted by GNATS.

From: sethml@ofb.net
To: rodrigc@gcc.gnu.org
Cc: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
	nobody@gcc.gnu.org, sethml@ofb.net
Subject: Re: c++/5000: volatile asm code fails in template class member functions 
Date: Mon, 03 Dec 2001 21:29:57 -0800

 > Synopsis: volatile asm code fails in template class member functions
 > 
 > State-Changed-From-To: open->analyzed
 > State-Changed-By: rodrigc
 > State-Changed-When: Mon Dec  3 17:17:36 2001
 > State-Changed-Why:
 >     Compiling your testcase with gcc 3.0 yielded the following
 >     compilation error:
 >     
 >     b.cc: In function `int main()':
 >     b.cc:5: invalid `asm': operand number missing after %-letter
 >     b.cc:5: invalid `asm': operand number missing after %-letter
 >     
 >     If I changed the __asm__ line in your code to:
 >     
 >        __asm__ __volatile__ ("movl %%eax,%%eax");    
 >     
 >     Then it compiled without problem.
 
 And then if you try to compile it on gcc 2.95, it will fail to
 compile.  See bug report c++/4999.
 
 Seth


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

* Re: c++/5000: volatile asm code fails in template class member functions
@ 2001-12-03 17:26 rodrigc
  0 siblings, 0 replies; 6+ messages in thread
From: rodrigc @ 2001-12-03 17:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/5000; it has been noted by GNATS.

From: rodrigc@gcc.gnu.org
To: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
  nobody@gcc.gnu.org, sethml@ofb.net
Cc:  
Subject: Re: c++/5000: volatile asm code fails in template class member functions
Date: 4 Dec 2001 01:17:37 -0000

 Synopsis: volatile asm code fails in template class member functions
 
 State-Changed-From-To: open->analyzed
 State-Changed-By: rodrigc
 State-Changed-When: Mon Dec  3 17:17:36 2001
 State-Changed-Why:
     Compiling your testcase with gcc 3.0 yielded the following
     compilation error:
     
     b.cc: In function `int main()':
     b.cc:5: invalid `asm': operand number missing after %-letter
     b.cc:5: invalid `asm': operand number missing after %-letter
     
     If I changed the __asm__ line in your code to:
     
        __asm__ __volatile__ ("movl %%eax,%%eax");    
     
     Then it compiled without problem.
     
     Please see http://www.linuxassembly.org for a good tutorial
     on the asm syntax.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=5000&database=gcc


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

* c++/5000: volatile asm code fails in template class member functions
@ 2001-12-03 16:16 sethml
  0 siblings, 0 replies; 6+ messages in thread
From: sethml @ 2001-12-03 16:16 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5000
>Category:       c++
>Synopsis:       volatile asm code fails in template class member functions
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 03 16:16:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     sethml@ofb.net
>Release:        2.95.4
>Organization:
>Environment:
Debian unstable (sid) i386, Linux 2.2.17
>Description:
The compiler gets confused when a member function (static or not) of a template class contains volatile asm.  Attempting to compile the following:

  template <class X> struct test {
    static int foo() {
      __asm__ __volatile__ ("movl %eax %eax");
    }
  };

  int main() { 
    test<int>::foo();
    return 0;
  } 

results in:

  % g++ -v --save-temps bug2.cc
  Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
  gcc version 2.95.4 20011006 (Debian prerelease)
   /usr/lib/gcc-lib/i386-linux/2.95.4/cpp0 -lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ bug2.cc bug2.ii
  GNU CPP version 2.95.4 20011006 (Debian prerelease) (i386 Linux/ELF)
  #include "..." search starts here:
  #include <...> search starts here:
   /usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3
   /usr/local/include
   /usr/lib/gcc-lib/i386-linux/2.95.4/include
   /usr/include
  End of search list.
  The following default directories have been omitted from the search path:
   /usr/lib/gcc-lib/i386-linux/2.95.4/../../../../i386-linux/include
  End of omitted list.
   /usr/lib/gcc-lib/i386-linux/2.95.4/cc1plus bug2.ii -quiet -dumpbase bug2.cc -version -o bug2.s
  GNU C++ version 2.95.4 20011006 (Debian prerelease) (i386-linux) compiled by GNU C version 2.95.4 20011006 (Debian prerelease).
  bug2.cc: In function `static int test<int>::foo()':
  bug2.cc:8:   instantiated from here
  bug2.cc:3: `volatile' undeclared (first use this function)
  bug2.cc:3: (Each undeclared identifier is reported only once
  bug2.cc:3: for each function it appears in.)
  bug2.cc:3: warning:  qualifier ignored on asm

See also bug report titled "asm code with concatenated content fails in template class member functions".
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2001-12-04  8:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-03 17:17 c++/5000: volatile asm code fails in template class member functions rodrigc
  -- strict thread matches above, loose matches on Subject: below --
2001-12-04  0:16 rodrigc
2001-12-04  0:06 rodrigc
2001-12-03 21:36 sethml
2001-12-03 17:26 rodrigc
2001-12-03 16:16 sethml

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