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]

Maybe this is a bug of GCC?


Hi, Guys,

I met a problem when compiling a program.  
Then I make two small samples to test it.
One is called a1.c , another is a2.c.
And I   compiled them with:  gcc -o a1 a1.c        and
			  gcc -o a2 a2.c.
Then run them, I got two different results:

[may@linux2 temp]$ a2
a =0.985075 b =0.000000 c =0.000075 d = 0.000000
[may@linux2 temp]$ a1
a =0.985075 b =0.014850 c =0.000075 d = 0.000000

The result of a1 is the correct result.

But, I think the result should be the same.
Because the only difference between them is at line 15:

In a1.c:		b = 3 * t * t_12;
In a2.c:		b = 3 * t1* t_12;

And I already have a sentence that let t1 equals t. ( Line 10: t1 = t . )


So , I think maybe this is a problem of optimize?

As a potential lover of GNU software, I hope I am wrong.

[Note from gnu@gnu.org, which is forwarding this:  next message has
version details and more info.]
--

Regards,

Ma Yu
____________________
email: mayu@master.ihep.ac.cn
http://alpha01.ihep.ac.cn/~may


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