This is the mail archive of the gcc-patches@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]

3.1 dbxout.c: Skip non-COMPLEX_TYPE CONCAT RTL's


This patch is the same as for gcc 3.0
(http://gcc.gnu.org/ml/gcc-patches/2001-05/msg01168.html) except
shifted by a few lines.

Compiling this C++ program:

    #include <complex>

    template <int Dim, class T>
    class Engine
    {
    public:
      Engine (T val = T()) {}
    };

    int main()
    {
      Engine<1, std::complex<double> > e;
      return 0;
    }

yields a CONCAT RTL that has a record type, not COMPLEX_TYPE.  This
change prevents a segmentation fault but does not add debugging
information.  In the long run, this patch should be replaced with code
that produces debugging information.

The corresponding testcase
gcc/testsuite/g++.old-deja/g++.other/debug9.C exhibits this problem.

2001-05-17  Jeffrey Oldham  <oldham@codesourcery.com>

        * dbxout.c (dbxout_symbol_location): For CONCAT, skip types not
        COMPLEX_TYPE.

Branch          gcc 3.1
Tested on       i686-pc-linux-gnu
Approved by     Mark Mitchell (mark@codesourcery.com)

Thanks,
Jeffrey D. Oldham
oldham@codesourcery.com
Index: dbxout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dbxout.c,v
retrieving revision 1.72.4.6
diff -c -p -r1.72.4.6 dbxout.c
*** dbxout.c	2001/04/18 06:15:20	1.72.4.6
--- dbxout.c	2001/05/17 16:17:50
*************** dbxout_symbol_location (decl, type, suff
*** 2182,2188 ****
      }
    else if (GET_CODE (home) == CONCAT)
      {
!       tree subtype = TREE_TYPE (type);
  
        /* If the variable's storage is in two parts,
  	 output each as a separate stab with a modified name.  */
--- 2182,2196 ----
      }
    else if (GET_CODE (home) == CONCAT)
      {
!       tree subtype;
! 
!       /* If TYPE is not a COMPLEX_TYPE (it might be a RECORD_TYPE,
! 	 for example), then there is no easy way to figure out
! 	 what SUBTYPE should be.  So, we give up.  */
!       if (TREE_CODE (type) != COMPLEX_TYPE)
! 	return 0;
! 
!       subtype = TREE_TYPE (type);
  
        /* If the variable's storage is in two parts,
  	 output each as a separate stab with a modified name.  */

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