473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Is this a VC7.1 optimizer bug?

I'm seeing a problem where with -O2 -Ob2 on, my compiled code loads the
floating point value 1.0f on top of the floating point register stack (ST0),
then calls some functions (which happens to call driver functions in the
kernel), then later when it needs to assign the constant 1.0f to a variable,
it tries to use the value stored in ST0. The only problem is that the 1.0f
value is no longer there, the call into the kernel has set ST0 to float NaN!
Is this a problem with the VC optimizer (incorrectly assuming calls won't
modify the FP stack) or with the kernel call that modifies the FP stack?

Nov 17 '05 #1
3 820
>I'm seeing a problem where with -O2 -Ob2 on, my compiled code loads the
floating point value 1.0f on top of the floating point register stack (ST0),
then calls some functions (which happens to call driver functions in the
kernel), then later when it needs to assign the constant 1.0f to a variable,
it tries to use the value stored in ST0. The only problem is that the 1.0f
value is no longer there, the call into the kernel has set ST0 to float NaN!


James,

Do you have a short example that anyone can use to reproduce the
problem?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #2


"David Lowndes" wrote:
I'm seeing a problem where with -O2 -Ob2 on, my compiled code loads the
floating point value 1.0f on top of the floating point register stack (ST0),
then calls some functions (which happens to call driver functions in the
kernel), then later when it needs to assign the constant 1.0f to a variable,
it tries to use the value stored in ST0. The only problem is that the 1.0f
value is no longer there, the call into the kernel has set ST0 to float NaN!


James,

Do you have a short example that anyone can use to reproduce the
problem?


No, and it's unlikely I can make one since the kernel call in question is
NtGdiDrawPrimitives2, which calls into graphics driver code which of course
is video-card specific, and the problem only occurs with my rather large
dataset, although it is 100% reproducible. I was just hoping some
assembly/windows kernel guru would know if I should be pointing the finger of
blame at the compiler or the kernel/driver.
Nov 17 '05 #3
>> Do you have a short example that anyone can use to reproduce the
problem?


No, and it's unlikely I can make one since the kernel call in question is
NtGdiDrawPrimitives2, which calls into graphics driver code which of course
is video-card specific, and the problem only occurs with my rather large
dataset, although it is 100% reproducible.


A quick google on that kernel call you mention shows up nothing, so I
think the hard part is going to be finding someone who's familiar with
that. I don't know where to suggest you find such a person.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nick Mudge | last post by:
Hi, Does anybody know the performance difference between having your PHP code cached and just running your code with the zend optimizer? Is there much difference? Nick
9
by: hemal | last post by:
I came across a very strange situation at work. There is an order of magnitude difference in execution time for the following two queries (10 v/s ~130 msec): select count(*) from table_name...
2
by: gefek | last post by:
Hello, I've got a server postgresql 7.4.6 installed from RPM for linux RH 9. Lately, I've noticed, that some queries last too long... It appears to me, that the optimizer does not use index...
3
by: Philip Yale | last post by:
I'm very puzzled by the choice of NC index being made by the optimizer in this example. I don't actually think it should use an NC index at all. I have: Table: CustomerStatus_T Single data...
3
by: Peter Arrenbrecht | last post by:
Hi all We ran into a very annoying optimizer problem recently. We had added a new key and self-join relation to a large production table. That key will be filled very rarely and having just...
9
by: Andrea | last post by:
Hi, I've read the former postings but was not able to solve my problem: I have a Summary Table (or MQT as you like it) and the query optimizer does not seem to use the summary table. I run...
5
by: Kevin | last post by:
Using a base table, a MQT table was created. With optimization - when querying the base table with calcuation that are already completed in the MQT - I would assume the optimizer would use the MQT...
2
by: boa sema | last post by:
Way back when, and at least in version 7 IIRC, the query optimizer gave up when the where clause in a statement contained more than 4 search conditions. Does anyone know if such a limitation...
3
by: aj | last post by:
DB2 LUW v8.2 FP 14 RHAS 2.1 Sorry if these are newbie questions. Optimizer stuff is black magic to me. For both of these, assume stats are current and an even distribution of data....
0
by: P. Adhia | last post by:
Hi, Consider the following query select * from t1 where c1 = ? and c2 = ?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.