Closed Bug 1522203 Opened 6 years ago Closed 5 years ago

Clang warns about unsequenced code in Pentium Pro workaround

Categories

(NSS :: Libraries, defect, P1)

x86
Windows XP
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: away, Assigned: jcj)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

https://searchfox.org/mozilla-central/rev/39265dd58298c40bed029617ad408bf806cce761/security/nss/lib/pk11wrap/pk11slot.c#2099-2102,2128-2137

#if defined(XP_WIN32)
/* This is works around some horrible cache/page thrashing problems
** on Win32. Without this, this loop can take up to 6 seconds at
** 100% CPU on a Pentium-Pro 200. The thing this changes is to
** increase the size of the stack frame and modify it.
** Moving the loop code itself seems to have no effect.
** Dunno why this combination makes a difference, but it does.
*/
waste[j & 0xf] = j++;
#endif

I only noticed it because I happened to see this warning scroll past during a build:

17:12:55 INFO - z:/build/build/src/security/nss/lib/pk11wrap/pk11slot.c(2136,27): warning: unsequenced modification and access to 'j' [-Wunsequenced]
17:12:55 INFO - waste[j & 0xf] = j++;

Do we still need this workaround?

That's amazing.

I'll patch this out in NSS 3.43.

Assignee: nobody → jjones
Severity: normal → trivial
Status: NEW → ASSIGNED
OS: Unspecified → Windows XP
Priority: -- → P1
Hardware: Unspecified → x86
Target Milestone: --- → 3.43

(In reply to J.C. Jones [:jcj] (he/him) from comment #1)

I'll patch this out in NSS 3.43.

Is this still the plan? :-)

Flags: needinfo?(jjones)

The comment indicated the wasted effort was to work around a cache issue on the
Pentium Pro. I think it has served its purpose.

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: 3.43 → 3.48
Flags: needinfo?(jjones)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: