Issue Details (XML | Word | Printable)

Key: PCC-265
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Iain Hibbert
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
pcc

cannot generate code for maths with ternary expression

Created: 27/Feb/11 07:50 PM   Updated: 27/Feb/11 10:08 PM
Component/s: i386 target
Affects Version/s: None
Fix Version/s: None

Environment: NetBSD/i386


 Description  « Hide
Hi, the following code fragment

int foo (int i, unsigned int u)
{
return u / (i < 10 ? 32 : i);
}

fails to compile with

compiler error: Cannot generate code, node 0xbb950688 op /


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 27/Feb/11 10:08 PM
Fixed. Type conversions should not be propagated down if it is a ? or , operator.