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]

gcc 2.95.2 optimise problem (fwd)


This bug was reported on the gcc mailing list.  I wanted to be sure that it
got attention on the bugs list as well.

Mike

----- Forwarded message from Min Xu <mxu@cae.wisc.edu> -----

Date: Fri, 31 Mar 2000 17:13:20 -0600
From: Min Xu <mxu@cae.wisc.edu>
Reply-To: mxu@cae.wisc.edu
To: Michael Gerdts <gerdts@cae.wisc.edu>
Subject: gcc 2.95.2 optimise problem

Hi Mike,
  After several experiments on it, I think I have pretty much confidence to
report this bug to you(I already post this to gcc mail list though). The new
2.95.2 gcc compiler on CAE system is somehow buggy. The default behavior
(for -O2) is broken for the small piece of code I am sending you as the
attachment.
  Even I don't put -O2 option, I also got a bus in a function call. I found it
is safest to put -msupersparc(or -mcypress? I didn't try this) to my program,
in this case, there is no mysterious bus error and core dump.
   The problem is repeatable on CAE system. You can try to run the file
I attached.
   I am not a expert on this issue, hope I didn't make stupid mistake on this.
Thank you.
Min


#include <iostream>
#include "ind_table_parser.h"

int main()
{
	double Lm;
	ind_table_parser ind_t;

	cout << "Begin the test program...\n";
	Lm = ind_t.findLm(200000, 200000, 800, 800, 1000, 1000, 3000, 0, 0, 1e10);
	cout << "Lm: " << Lm << "\n";

	return (0);
}

#include "ind_table_parser.h"

/*****************************************
 * Implementation of the table calss     *
 *****************************************/

double ind_table_parser::findLm(int length1, int length2, int width1,
				int width2, int thick1, int thick2,
				int space, int v_distance,
				int displace, double freq)
{

//	if((freq > (1e11*10.0)) || (freq < (1e9/10.0))) {
	if(freq > 1e10) {
		return (1.0);
	}

	return (0.0);
}


#ifndef __ind_table_parser_h
#define __ind_table_parser_h

/******************************
 * Define the table calss     *
 ******************************/
class ind_table_parser { 

public:
	double findLm(int l1, int l2, int w1, int w2, int t1,
		      int t2, int s , int v , int d, double freq);


};

#endif

# Makefile for inductance calculation library
# author: Min Xu
# date: 2000-01-25
#
# build both the test program and the library

##
# for solaris
##
CC = gcc

CFLAGS = -O2 -g -Wall
#CFLAGS = -msupersparc -O2 -Wall

#.SUFFIXES:

all:	cpp_test

ind_table_parser.o: ind_table_parser.cc ind_table_parser.h
	$(CC) $(CFLAGS) -c -o ind_table_parser.o ind_table_parser.cc

cpp_test: cpp_test.cc ind_table_parser.o
	$(CC) $(CFLAGS) -lm -lstdc++ -o cpp_test cpp_test.cc ind_table_parser.o

clean:
	rm -f libRLC_calc.so c_test cpp_test matrix_test demo_test full_model *.class *.o out *.lib core


----- End forwarded message -----

-- 
Mike Gerdts
UNIX Systems Administrator
Computer-Aided Engineering Center
University of Wisconsin - Madison

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