Hardware 版 (精华区)
发信人: edmcgy (达达尼), 信区: Hardware
标 题: DSP(Data Signal Processor)的应用(9)
发信站: 紫 丁 香 (Thu Apr 23 15:29:08 1998), 转信
Workaround/Solution
WORKAROUND/SOLUTION
===================
Problem will be fixed with next release.
Title: Compiler may gen incorrect code for compare of bit field to power of 2"
Bug #
Tool
Version
Fixed?
SDSsq02109
Compiler
V6.60
Fixed, will appear in next release.
Bug Description
BUG DESCRIPTION
===============
Given the expression
(s.bf2 & POW2)
where "s.bf2" is a bit field in a structure which is *not* the first member
of that structure, and "POW2" is a power of 2, the compiler generates
incorrect code when such expressions are used for conditional branches.
Conditional branches include "if" statements, "while" and "for" loops,
operands of "&&" and "||", etc. For example:
struct fields
{
unsigned bf1 : 4;
unsigned bf2 : 4;
} s;
...
if (s.bf2 & 8) /* generates incorrect code */
--
※ 来源:.紫 丁 香 bbs.hit.edu.cn.[FROM: edmcgy.hit.edu.c]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.981毫秒