diff options
author | Michael Forney <mforney@mforney.org> | 2019-08-12 01:53:46 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-08-12 02:01:49 -0700 |
commit | 0d1969024c6fd7fa9aa729cf17860d0c172b56e0 (patch) | |
tree | b68d38ff7638223933750372a6f0151be59958cb /test | |
parent | e506961aabd683bfb54357c00f8150984bd0690f (diff) | |
download | cproc-0d1969024c6fd7fa9aa729cf17860d0c172b56e0.tar.xz |
Revert "expr: Fix cast of same type"
This reverts commit 1a38a5fc4844a0de8729be694a62ba0afce3ff52.
This breaks comparisons bitfields in some cases, for instance
extern struct {unsigned x:31;} s;
int main(void) {
return (unsigned)s.x - 1 < 0;
}
If we discard the cast, then it is a signed comparison because of integer
promotion for bit-fields, otherwise it is an unsigned comparison.
Additionally, the test case this was meant to fix is not actually ISO C,
since casts must be to scalar types or `void`.
Diffstat (limited to 'test')
-rw-r--r-- | test/cast-same-type.qbe | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/test/cast-same-type.qbe b/test/cast-same-type.qbe deleted file mode 100644 index 625f937..0000000 --- a/test/cast-same-type.qbe +++ /dev/null @@ -1,12 +0,0 @@ -export -function w $main() { -@start.1 -@body.2 - %.1 =l copy $s - %.2 =l mul 0, 1 - %.3 =l add %.1, %.2 - %.4 =l copy %.3 - %.5 =w loadsw %.4 - ret %.5 -} -export data $s = align 4 { z 4 } |