<< Back to previous view

[PCC-392] compiler error when double casting pointer to bool Created: 06/May/12  Updated: 10/May/12

Status: Resolved
Project: pcc
Component/s: amd64 target
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Nicolas Joly Assignee: Anders Magnusson
Resolution: Fixed Votes: 0
Environment: 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

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 $?

Comment by Anders Magnusson [ 10/May/12 05:42 PM ]
Fixed. One more late optimizing needed.
Generated at Sat Oct 21 06:58:53 CEST 2017 using JIRA Enterprise Edition, Version: 3.13.1-#333.