public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/3545: ICE passing a class object to inline assembly
@ 2002-04-12 19:32 rodrigc
  0 siblings, 0 replies; 3+ messages in thread
From: rodrigc @ 2002-04-12 19:32 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, peter

Synopsis: ICE passing a class object to inline assembly

State-Changed-From-To: analyzed->closed
State-Changed-By: rodrigc
State-Changed-When: Fri Apr 12 19:32:56 2002
State-Changed-Why:
    Submitter says it works with gcc 3.0.3

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


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

* Re: c++/3545: ICE passing a class object to inline assembly
@ 2002-04-06  8:06 Peter Skvarenina
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Skvarenina @ 2002-04-06  8:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Peter Skvarenina <peter@frix.fri.utc.sk>
To: rth@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, 
 nobody@gcc.gnu.org, peter@frix.fri.utc.sk, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/3545: ICE passing a class object to inline assembly
Date: Sat, 6 Apr 2002 17:58:13 +0200 (CEST)

 > Old Synopsis: ICE in emit_move_insn, at expr.c:2724
 > New Synopsis: ICE passing a class object to inline assembly
 > 
 > State-Changed-From-To: open->analyzed
 > State-Changed-By: rth
 > State-Changed-When: Thu Apr  4 04:07:54 2002
 > State-Changed-Why:
 >     ICE still happens with gcc 3.1 prelease.
 >     A reduced test case is
 >     
 >     class cCislo
 >     {
 >     public:
 >       long Cislo;
 >     
 >       cCislo () { Cislo = 0; }
 >       cCislo (const cCislo &P) { Cislo = P.Cislo; }
 >       cCislo (int A) { Cislo = A; }
 >     };
 >     
 >     void foo(cCislo A, cCislo B)
 >     {
 >       cCislo Sucet;
 >       asm volatile ("AddL %2, %1"
 >                     : "=g" (Sucet)
 >                     : "0" (A), "q" (B)
 >                     : "cc");
 >     }
 >     
 >     The problem here is that the compiler Really does not want
 >     to pass a class to an asm.  The fix for this will involve
 >     issuing an error for this mistake.
 >     
 >     What you wanted is to pass "A.Cislo" to the asm, not "A".
 >     Similarly for the other asm arguments.
 > 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3545
 > 
 
 After I posted this message, I realised my mistake and replaced all affected
 statements to access 'Cislo' member. But it has still remainded (ICE) up to
 version 3.0.1 of the GCC.
 
 But after GCC 3.0.3, it is now working ;') (I haven't tested it for GCC
 3.0.2)
 
 This applies to original, non-reduced case with access to 'Cislo' instead of
 class instance. It was important, that there were inline operators +, -, etc.
 When I moved code from these operators to another inline functions and called
 them from those operators, ICE haven't been issued. (Both foo and op were
 inline). But it leads to *very* ineffective code with gcc 3.0.0 ;( 
 
 Thank you for all, these inline optimizations can greatly save time.
 
                                              Peter


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

* Re: c++/3545: ICE passing a class object to inline assembly
@ 2002-04-04  4:07 rth
  0 siblings, 0 replies; 3+ messages in thread
From: rth @ 2002-04-04  4:07 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, peter

Old Synopsis: ICE in emit_move_insn, at expr.c:2724
New Synopsis: ICE passing a class object to inline assembly

State-Changed-From-To: open->analyzed
State-Changed-By: rth
State-Changed-When: Thu Apr  4 04:07:54 2002
State-Changed-Why:
    ICE still happens with gcc 3.1 prelease.
    A reduced test case is
    
    class cCislo
    {
    public:
      long Cislo;
    
      cCislo () { Cislo = 0; }
      cCislo (const cCislo &P) { Cislo = P.Cislo; }
      cCislo (int A) { Cislo = A; }
    };
    
    void foo(cCislo A, cCislo B)
    {
      cCislo Sucet;
      asm volatile ("AddL %2, %1"
                    : "=g" (Sucet)
                    : "0" (A), "q" (B)
                    : "cc");
    }
    
    The problem here is that the compiler Really does not want
    to pass a class to an asm.  The fix for this will involve
    issuing an error for this mistake.
    
    What you wanted is to pass "A.Cislo" to the asm, not "A".
    Similarly for the other asm arguments.

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


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

end of thread, other threads:[~2002-04-13  2:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-12 19:32 c++/3545: ICE passing a class object to inline assembly rodrigc
  -- strict thread matches above, loose matches on Subject: below --
2002-04-06  8:06 Peter Skvarenina
2002-04-04  4:07 rth

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