This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/2115: asm bug related to inline function



>Number:         2115
>Category:       c++
>Synopsis:       asm problem with g++ and inline functions
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 27 02:36:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Sylvain.Pion@sophia.inria.fr
>Release:        3.0 20010227 (prerelease)
>Organization:
>Environment:
System: Linux zosma 2.2.14 #1 SMP Fri Jan 14 14:39:36 MET 2000 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /u/zosma/0/prisme/spion/gcc/gcc/configure --with-as=/u/zosma/0/prisme/spion/gcc/Binutils/Linux/bin/as --with-ld=/u/zosma/0/prisme/spion/gcc/Binutils/Linux/bin/ld --enable-languages=c++ --prefix=/u/zosma/0/prisme/spion/gcc/Linux_CVS_v3
>Description:

The following program produces the error :

bug_report_asm.c: In function `double f(double)':
bug_report_asm.c:5: output number 0 not directly addressable
bug_report_asm.c:7: confused by earlier errors, bailing out

The current g++ (from the 3.0 branch) refuses the code, while the C compiler
accepts it, just like g++ 2.95.2 did.
Removing "inline" also makes it work, but then it's a performance drop, and
this workaround doesn't work with -O2 anyway.

This report probably points to the same bug as PR 1760.

>How-To-Repeat:

inline
double f (double x)
{
  asm ("" : "=m"(x) : "m"(x));
  return x;
}

int main()
{
    double i;
    double j = 3.0;
    i = f(j);
    return 0;
}

>Fix:

I don't know of any really effective workaround.
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]