Issue Details (XML | Word | Printable)

Key: PCC-392
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Nicolas Joly
Votes: 0
Watchers: 0

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

compiler error when double casting pointer to bool

Created: 06/May/12 11:21 PM   Updated: 10/May/12 05:42 PM
Component/s: amd64 target
Affects Version/s: None
Fix Version/s: None

NetBSD petaure.lan 6.99.6 NetBSD 6.99.6 (PETAURE) #28: Sun May 6 22:15:36 CEST 2012 njoly@petaure.lan:/local/src/NetBSD/obj.amd64/sys/arch/amd64/compile/PETAURE amd64
pcc 1.1.0.DEVEL 20120423 for x86_64-unknown-netbsd6.99.6

 Description  « Hide
When double casting pointers to bool, the pcc compiler gets an internal error on amd64.
This is a regression as it was working previously.

njoly@petaure [~]> cat sample.c
#include <assert.h>
#include <stdbool.h>

int main() {
  assert((bool)(void *)NULL == false);
  assert((bool)(void *)-1 == true);
  return 0; }

njoly@petaure [~]> pcc --version
pcc 1.1.0.DEVEL 20120423 for x86_64-unknown-netbsd6.99.6
njoly@petaure [~]> pcc -g -o sample sample.c; echo $?
sample.c, line 7: compiler error: 0x7f7ff77103d0) not logop branch

njoly@petaure [~]> gcc --version
gcc (NetBSD nb2 20110806) 4.5.3
njoly@petaure [~]> gcc -g -o sample sample.c; echo $?

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson made changes - 10/May/12 05:42 PM
Field Original Value New Value
Assignee Anders Magnusson [ ragge ]
Anders Magnusson added a comment - 10/May/12 05:42 PM
Fixed. One more late optimizing needed.

Anders Magnusson made changes - 10/May/12 05:42 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]