Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(556)

Issue 1826043002: S390: Fixed s390 simulation check for underflow in subtraction. (Closed)

Created:
4 years, 9 months ago by bcleung
Modified:
4 years, 8 months ago
CC:
v8-reviews_googlegroups.com
Base URL:
https://github.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

S390: Fixed s390 simulation check for underflow in subtraction. Clang optimizes away CheckOverflowForIntSub at any opt level (includes -O1, -O2, -O3) into a false statement, resulting in incorrect values being returned. As the C++ standard considers overflows to be undefined behaviour, this is technically correct as compilers can assume that overflows never occur, but problematic in our case (where overflows do occur, and a specific result is expected). This change replaces the original check with a call to a function that is optimized in a manner that returns correct output. R=michael_dawson@ca.ibm.com,jyan@ca.ibm.com,mtbrandyberry@ca.ibm.com,joransiu@ca.ibm.com,jkummerow@chromium.org,jochen@chromium.org,danno@chromium.org BUG= Committed: https://crrev.com/0d24a0fcfe8c7e1f546b5747679dcee51d0f071e Cr-Commit-Position: refs/heads/master@{#35082}

Patch Set 1 #

Patch Set 2 : Added explicit typing for signed int over/underflow checking #

Patch Set 3 : Added a TODO re: indirect static casting #

Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -44 lines) Patch
M src/s390/simulator-s390.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/s390/simulator-s390.cc View 1 2 20 chunks +54 lines, -42 lines 0 comments Download

Messages

Total messages: 25 (14 generated)
jochen (gone - plz use gerrit)
can you please file a bug against clang for this issue?
4 years, 9 months ago (2016-03-24 14:46:24 UTC) #3
bcleung
On 2016/03/24 14:46:24, jochen - slow wrote: > can you please file a bug against ...
4 years, 9 months ago (2016-03-24 15:04:51 UTC) #4
bcleung
On 2016/03/24 15:04:51, bryleun wrote: > On 2016/03/24 14:46:24, jochen - slow wrote: > > ...
4 years, 9 months ago (2016-03-24 15:08:07 UTC) #6
JoranSiu
Patch set 3 lgtm
4 years, 9 months ago (2016-03-24 20:48:45 UTC) #8
bcleung
4 years, 8 months ago (2016-03-28 13:55:00 UTC) #9
ofrobots
On 2016/03/28 13:55:00, bcleung wrote: Another approach here would be to use the `-fwrapv` compiler ...
4 years, 8 months ago (2016-03-28 15:22:44 UTC) #10
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1826043002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1826043002/40001
4 years, 8 months ago (2016-03-28 15:28:10 UTC) #12
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-03-28 15:51:42 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1826043002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1826043002/40001
4 years, 8 months ago (2016-03-28 17:11:11 UTC) #17
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 8 months ago (2016-03-28 17:12:54 UTC) #19
commit-bot: I haz the power
4 years, 8 months ago (2016-03-28 17:13:57 UTC) #21
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/0d24a0fcfe8c7e1f546b5747679dcee51d0f071e
Cr-Commit-Position: refs/heads/master@{#35082}

Powered by Google App Engine
This is Rietveld 408576698