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]
Other format: [Raw text]

[Bug c++/12723] New: tree-ssa regression -- Error with templated args to atan2


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: tree-ssa regression -- Error with templated args to
                    atan2
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ctsa at u dot washington dot edu
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-redhat-linux
  GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux

tree-ssa gcc exits gracefully with an assembler error when atan2 is called with
template dependent argument types at the -O optimization level.

) test case: 

error.cc
"""
#include <cmath>

template<class T>
struct A { typedef T y;};

template<>
struct A<double> { typedef long double y;};

A<double>::y f();


main() { std::atan2(f(),f()); }
"""


) Machine: 

redhat 9. athlon

$ rpm -q glibc binutils kernel
glibc-2.3.2-27.9
binutils-2.13.90.0.18-9
kernel-2.4.20-19.9


) g++ binary causin' all the trouble:

Recent build of the tree-ssa branch -

$ /users/ctsa/devel/gcc/tree-ssa/install/bin/g++ -v
Reading specs from
/home/ctsa/devel/gcc/tree-ssa/install/bin/../lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa/specs
Configured with: ../gcc/configure
--prefix=/users/ctsa/devel/gcc/tree-ssa/install -enable-languages=c,c++
Thread model: posix
gcc version 3.5-tree-ssa 20031022 (merged 20031017)


) command-line and error output: 

$ /users/ctsa/devel/gcc/tree-ssa/install/bin/g++ -O -c error.cc
/usr/include/bits/mathinline.h: In function `int main()':
/usr/include/bits/mathinline.h:426: error: can't find a register in class
`FP_TOP_REG' while reloading `asm'


) This error occurs only with -O or higher optimization. I tested the mode flags
attributed to -O but couldn't recreate it with any one of them. I don't see this
problem using gcc-3.3.2 for any optimization level, so I'm guessing it's a
regression. For anyone interested in random trivia, the test case is abstracted
out of a larger app's interaction with the Boost uBlas library type_traits<> class.


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