Issue Details (XML | Word | Printable)

Key: PCC-383
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Nicolas Joly
Votes: 0
Watchers: 0
Operations

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

(bool)(void *)-1 is not true with pcc on i386

Created: 09/Oct/11 06:40 PM   Updated: 06/Mar/12 07:19 PM
Component/s: i386 target
Affects Version/s: None
Fix Version/s: None

Environment:
NetBSD petaure.lan 5.99.56 NetBSD 5.99.56 (PETAURE) #17: Sat Oct 8 22:55:15 CEST 2011 njoly@petaure.lan:/local/src/NetBSD/obj.amd64/sys/arch/amd64/compile/PETAURE i386
pcc 1.1.0.DEVEL 20110928 for i386-unknown-netbsdelf5.99.56


 Description  « Hide
The following sample code succeed on amd64 but fails on i386 (amd64 under compat netbsd32, but that shouldn't matters). No problem with gcc, either for i386 and amd64.

njoly@petaure [netbsd32:pcc]> cat sample.c
#include <assert.h>
#include <stdbool.h>
int main() {
  assert((bool)(void *)-1 == true);
  return 0; }

njoly@petaure [netbsd32:pcc]> pcc --version
pcc 1.1.0.DEVEL 20110928 for i386-unknown-netbsdelf5.99.56
njoly@petaure [netbsd32:pcc]> pcc -g -Wall -Werror -o sample sample.c
njoly@petaure [netbsd32:pcc]> ./sample; echo $?
assertion "(bool)(void *)-1 == true" failed: file "sample.c", line 4, function "main"
Abort (core dumped)
134

njoly@petaure [tmp/pcc]> pcc --version
pcc 1.1.0.DEVEL 20110928 for x86_64-unknown-netbsd5.99.56
njoly@petaure [tmp/pcc]> pcc -g -Wall -Werror -o sample sample.c
njoly@petaure [tmp/pcc]> ./sample; echo $?
0

njoly@petaure [netbsd32:pcc]> gcc --version
gcc (NetBSD nb2 20110806) 4.5.3
njoly@petaure [netbsd32:pcc]> gcc -g -Wall -Werror -o sample sample.c
njoly@petaure [netbsd32:pcc]> ./sample; echo $?
0


 All   Comments   Change History      Sort Order: Descending order - Click to sort in ascending order
Anders Magnusson added a comment - 06/Mar/12 07:19 PM
Fixed by Will Noble on pcc-list.