Searched hist:107 (Results 1 - 25 of 760) sorted by relevance
/netbsd-current/sys/arch/arm/conf/ | ||
H A D | majors.arm32 | diff 1.17 Wed Dec 22 19:23:18 MST 2004 joff char major 107 to ep93xx processor UART driver epcom diff 1.17 Wed Dec 22 19:23:18 MST 2004 joff char major 107 to ep93xx processor UART driver epcom diff 1.17 Wed Dec 22 19:23:18 MST 2004 joff char major 107 to ep93xx processor UART driver epcom diff 1.17 Wed Dec 22 19:23:18 MST 2004 joff char major 107 to ep93xx processor UART driver epcom |
/netbsd-current/lib/libform/ | ||
H A D | internals.c | diff 1.31 Sun Mar 19 20:08:09 MST 2006 christos Coverity CID 107[123]: Leave the assertions in the code, not only when DEBUG is set. diff 1.31 Sun Mar 19 20:08:09 MST 2006 christos Coverity CID 107[123]: Leave the assertions in the code, not only when DEBUG is set. diff 1.31 Sun Mar 19 20:08:09 MST 2006 christos Coverity CID 107[123]: Leave the assertions in the code, not only when DEBUG is set. diff 1.31 Sun Mar 19 20:08:09 MST 2006 christos Coverity CID 107[123]: Leave the assertions in the code, not only when DEBUG is set. diff 1.31 Sun Mar 19 20:08:09 MST 2006 christos Coverity CID 107[123]: Leave the assertions in the code, not only when DEBUG is set. diff 1.31 Sun Mar 19 20:08:09 MST 2006 christos Coverity CID 107[123]: Leave the assertions in the code, not only when DEBUG is set. |
/netbsd-current/sys/dev/pci/ | ||
H A D | xhci_pci.c | diff 1.31 Tue Oct 11 09:18:22 MDT 2022 msaitoh There is an xHCI device which has USB 2 port only. Support it. - Example: xhci4 at pci17 dev 0 function 0: AMD product 15b8 (rev. 0x00) xhci4: 64-bit DMA allocated pic msix10 type edge pin 0 level 6 to cpu0 slot 32 idt entry 107 xhci4: interrupting at msix10 vec 0 xhci4: xHCI version 1.20 xhci4: hcs1=1000840 hcs2=140000f1 hcs3=7000a xhci4: hcc=0x110ffc5<XECP=0x110,MAXPSA=0xf,CFC,SEC,SPC,PAE,NSS,LTC,CSZ,AC64> xhci4: xECP 440 xhci4: hcc2=0x3f<CIC,LEC,CTC,FSC,CMC,U3C> xhci4: ECR: 0x00000401 xhci4: ECR: 0x02000402 xhci4: SP: 0x02000402 0x20425355 0x00180101 0x00000000 xhci4: hs ports 1 - 1 xhci4: ECR: 0x000f000a xhci4: PAGESIZE 0x00000001 xhci4: sc_pgsz 0x00001000 xhci4: sc_maxslots 0x00000040 xhci4: sc_maxports 1 xhci4: sc_maxspbuf 2 xhci4: eventst: 0x000000013ee60fc0 0xffffb08826f5afc0 1000 xhci4: dcbaa: 0x000000013ee63000 0xffffb08826f5b000 1000 xhci4: current IMOD 0 (snip) usb8 at xhci4: USB revision 3.1 usb9 at xhci4: USB revision 2.0 uhub8 at usb8: NetBSD (0x0000) xHCI root hub (0x0000), class 9/0, rev 3.00/1.00, addr 0 uhub8: 0 ports with 0 removable, self powered uhub8: no ports, hub ignored uhub8: WARNING: power management not supported autoconfiguration error: usb8: root device is not a hub usb8: WARNING: power management not supported uhub9 at usb9: NetBSD (0x0000) xHCI root hub (0x0000), class 9/0, rev 2.00/1.00, addr 0 uhub9: 1 port with 1 removable, self powered - To resolve this problem, keep number of ports of SS and HS and use it to attach child device(s). - Tested on ASUS TUF GAMING X670E-PLUS. - OK'd by skrll@. diff 1.31 Tue Oct 11 09:18:22 MDT 2022 msaitoh There is an xHCI device which has USB 2 port only. Support it. - Example: xhci4 at pci17 dev 0 function 0: AMD product 15b8 (rev. 0x00) xhci4: 64-bit DMA allocated pic msix10 type edge pin 0 level 6 to cpu0 slot 32 idt entry 107 xhci4: interrupting at msix10 vec 0 xhci4: xHCI version 1.20 xhci4: hcs1=1000840 hcs2=140000f1 hcs3=7000a xhci4: hcc=0x110ffc5<XECP=0x110,MAXPSA=0xf,CFC,SEC,SPC,PAE,NSS,LTC,CSZ,AC64> xhci4: xECP 440 xhci4: hcc2=0x3f<CIC,LEC,CTC,FSC,CMC,U3C> xhci4: ECR: 0x00000401 xhci4: ECR: 0x02000402 xhci4: SP: 0x02000402 0x20425355 0x00180101 0x00000000 xhci4: hs ports 1 - 1 xhci4: ECR: 0x000f000a xhci4: PAGESIZE 0x00000001 xhci4: sc_pgsz 0x00001000 xhci4: sc_maxslots 0x00000040 xhci4: sc_maxports 1 xhci4: sc_maxspbuf 2 xhci4: eventst: 0x000000013ee60fc0 0xffffb08826f5afc0 1000 xhci4: dcbaa: 0x000000013ee63000 0xffffb08826f5b000 1000 xhci4: current IMOD 0 (snip) usb8 at xhci4: USB revision 3.1 usb9 at xhci4: USB revision 2.0 uhub8 at usb8: NetBSD (0x0000) xHCI root hub (0x0000), class 9/0, rev 3.00/1.00, addr 0 uhub8: 0 ports with 0 removable, self powered uhub8: no ports, hub ignored uhub8: WARNING: power management not supported autoconfiguration error: usb8: root device is not a hub usb8: WARNING: power management not supported uhub9 at usb9: NetBSD (0x0000) xHCI root hub (0x0000), class 9/0, rev 2.00/1.00, addr 0 uhub9: 1 port with 1 removable, self powered - To resolve this problem, keep number of ports of SS and HS and use it to attach child device(s). - Tested on ASUS TUF GAMING X670E-PLUS. - OK'd by skrll@. diff 1.31 Tue Oct 11 09:18:22 MDT 2022 msaitoh There is an xHCI device which has USB 2 port only. Support it. - Example: xhci4 at pci17 dev 0 function 0: AMD product 15b8 (rev. 0x00) xhci4: 64-bit DMA allocated pic msix10 type edge pin 0 level 6 to cpu0 slot 32 idt entry 107 xhci4: interrupting at msix10 vec 0 xhci4: xHCI version 1.20 xhci4: hcs1=1000840 hcs2=140000f1 hcs3=7000a xhci4: hcc=0x110ffc5<XECP=0x110,MAXPSA=0xf,CFC,SEC,SPC,PAE,NSS,LTC,CSZ,AC64> xhci4: xECP 440 xhci4: hcc2=0x3f<CIC,LEC,CTC,FSC,CMC,U3C> xhci4: ECR: 0x00000401 xhci4: ECR: 0x02000402 xhci4: SP: 0x02000402 0x20425355 0x00180101 0x00000000 xhci4: hs ports 1 - 1 xhci4: ECR: 0x000f000a xhci4: PAGESIZE 0x00000001 xhci4: sc_pgsz 0x00001000 xhci4: sc_maxslots 0x00000040 xhci4: sc_maxports 1 xhci4: sc_maxspbuf 2 xhci4: eventst: 0x000000013ee60fc0 0xffffb08826f5afc0 1000 xhci4: dcbaa: 0x000000013ee63000 0xffffb08826f5b000 1000 xhci4: current IMOD 0 (snip) usb8 at xhci4: USB revision 3.1 usb9 at xhci4: USB revision 2.0 uhub8 at usb8: NetBSD (0x0000) xHCI root hub (0x0000), class 9/0, rev 3.00/1.00, addr 0 uhub8: 0 ports with 0 removable, self powered uhub8: no ports, hub ignored uhub8: WARNING: power management not supported autoconfiguration error: usb8: root device is not a hub usb8: WARNING: power management not supported uhub9 at usb9: NetBSD (0x0000) xHCI root hub (0x0000), class 9/0, rev 2.00/1.00, addr 0 uhub9: 1 port with 1 removable, self powered - To resolve this problem, keep number of ports of SS and HS and use it to attach child device(s). - Tested on ASUS TUF GAMING X670E-PLUS. - OK'd by skrll@. |
/netbsd-current/sys/dev/usb/ | ||
H A D | xhcivar.h | diff 1.22 Tue Oct 11 09:18:22 MDT 2022 msaitoh There is an xHCI device which has USB 2 port only. Support it. - Example: xhci4 at pci17 dev 0 function 0: AMD product 15b8 (rev. 0x00) xhci4: 64-bit DMA allocated pic msix10 type edge pin 0 level 6 to cpu0 slot 32 idt entry 107 xhci4: interrupting at msix10 vec 0 xhci4: xHCI version 1.20 xhci4: hcs1=1000840 hcs2=140000f1 hcs3=7000a xhci4: hcc=0x110ffc5<XECP=0x110,MAXPSA=0xf,CFC,SEC,SPC,PAE,NSS,LTC,CSZ,AC64> xhci4: xECP 440 xhci4: hcc2=0x3f<CIC,LEC,CTC,FSC,CMC,U3C> xhci4: ECR: 0x00000401 xhci4: ECR: 0x02000402 xhci4: SP: 0x02000402 0x20425355 0x00180101 0x00000000 xhci4: hs ports 1 - 1 xhci4: ECR: 0x000f000a xhci4: PAGESIZE 0x00000001 xhci4: sc_pgsz 0x00001000 xhci4: sc_maxslots 0x00000040 xhci4: sc_maxports 1 xhci4: sc_maxspbuf 2 xhci4: eventst: 0x000000013ee60fc0 0xffffb08826f5afc0 1000 xhci4: dcbaa: 0x000000013ee63000 0xffffb08826f5b000 1000 xhci4: current IMOD 0 (snip) usb8 at xhci4: USB revision 3.1 usb9 at xhci4: USB revision 2.0 uhub8 at usb8: NetBSD (0x0000) xHCI root hub (0x0000), class 9/0, rev 3.00/1.00, addr 0 uhub8: 0 ports with 0 removable, self powered uhub8: no ports, hub ignored uhub8: WARNING: power management not supported autoconfiguration error: usb8: root device is not a hub usb8: WARNING: power management not supported uhub9 at usb9: NetBSD (0x0000) xHCI root hub (0x0000), class 9/0, rev 2.00/1.00, addr 0 uhub9: 1 port with 1 removable, self powered - To resolve this problem, keep number of ports of SS and HS and use it to attach child device(s). - Tested on ASUS TUF GAMING X670E-PLUS. - OK'd by skrll@. diff 1.22 Tue Oct 11 09:18:22 MDT 2022 msaitoh There is an xHCI device which has USB 2 port only. Support it. - Example: xhci4 at pci17 dev 0 function 0: AMD product 15b8 (rev. 0x00) xhci4: 64-bit DMA allocated pic msix10 type edge pin 0 level 6 to cpu0 slot 32 idt entry 107 xhci4: interrupting at msix10 vec 0 xhci4: xHCI version 1.20 xhci4: hcs1=1000840 hcs2=140000f1 hcs3=7000a xhci4: hcc=0x110ffc5<XECP=0x110,MAXPSA=0xf,CFC,SEC,SPC,PAE,NSS,LTC,CSZ,AC64> xhci4: xECP 440 xhci4: hcc2=0x3f<CIC,LEC,CTC,FSC,CMC,U3C> xhci4: ECR: 0x00000401 xhci4: ECR: 0x02000402 xhci4: SP: 0x02000402 0x20425355 0x00180101 0x00000000 xhci4: hs ports 1 - 1 xhci4: ECR: 0x000f000a xhci4: PAGESIZE 0x00000001 xhci4: sc_pgsz 0x00001000 xhci4: sc_maxslots 0x00000040 xhci4: sc_maxports 1 xhci4: sc_maxspbuf 2 xhci4: eventst: 0x000000013ee60fc0 0xffffb08826f5afc0 1000 xhci4: dcbaa: 0x000000013ee63000 0xffffb08826f5b000 1000 xhci4: current IMOD 0 (snip) usb8 at xhci4: USB revision 3.1 usb9 at xhci4: USB revision 2.0 uhub8 at usb8: NetBSD (0x0000) xHCI root hub (0x0000), class 9/0, rev 3.00/1.00, addr 0 uhub8: 0 ports with 0 removable, self powered uhub8: no ports, hub ignored uhub8: WARNING: power management not supported autoconfiguration error: usb8: root device is not a hub usb8: WARNING: power management not supported uhub9 at usb9: NetBSD (0x0000) xHCI root hub (0x0000), class 9/0, rev 2.00/1.00, addr 0 uhub9: 1 port with 1 removable, self powered - To resolve this problem, keep number of ports of SS and HS and use it to attach child device(s). - Tested on ASUS TUF GAMING X670E-PLUS. - OK'd by skrll@. |
/netbsd-current/external/bsd/pcc/dist/pcc/arch/i386/ | ||
H A D | local2.c | diff 1.1.1.3 Thu Jun 03 18:57:15 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
H A D | local.c | diff 1.1.1.3 Thu Jun 03 18:57:14 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
H A D | macdefs.h | diff 1.1.1.3 Thu Jun 03 18:57:15 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
H A D | code.c | diff 1.1.1.3 Thu Jun 03 18:57:14 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
H A D | table.c | diff 1.1.1.3 Thu Jun 03 18:57:16 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
H A D | order.c | diff 1.1.1.3 Thu Jun 03 18:57:16 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
/netbsd-current/external/bsd/pcc/dist/pcc/arch/hppa/ | ||
H A D | macdefs.h | diff 1.1.1.3 Thu Jun 03 18:57:13 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
H A D | local2.c | diff 1.1.1.3 Thu Jun 03 18:57:13 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
/netbsd-current/external/bsd/pcc/dist/pcc/mip/ | ||
H A D | regs.c | diff 1.1.1.3 Thu Jun 03 18:57:59 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
H A D | reader.c | diff 1.1.1.3 Thu Jun 03 18:57:57 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
H A D | pass2.h | diff 1.1.1.3 Thu Jun 03 18:57:56 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
/netbsd-current/external/bsd/pcc/dist/pcc/os/linux/ | ||
H A D | ccconfig.h | diff 1.1.1.3 Thu Jun 03 18:57:59 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
/netbsd-current/external/bsd/pcc/dist/pcc/os/dragonfly/ | ||
H A D | ccconfig.h | diff 1.1.1.2 Thu Jun 03 18:57:59 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
/netbsd-current/external/bsd/pcc/dist/pcc/os/midnightbsd/ | ||
H A D | ccconfig.h | diff 1.1.1.2 Thu Jun 03 18:57:59 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
/netbsd-current/external/bsd/pcc/dist/pcc/arch/vax/ | ||
H A D | local2.c | diff 1.1.1.3 Thu Jun 03 18:57:32 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
H A D | macdefs.h | diff 1.1.1.3 Thu Jun 03 18:57:32 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
H A D | code.c | diff 1.1.1.3 Thu Jun 03 18:57:32 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
H A D | order.c | diff 1.1.1.2 Thu Jun 03 18:57:33 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
H A D | local.c | diff 1.1.1.3 Thu Jun 03 18:57:32 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
H A D | table.c | diff 1.1.1.2 Thu Jun 03 18:57:33 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
/netbsd-current/external/bsd/pcc/dist/pcc/cc/cc/ | ||
H A D | Makefile.in | diff 1.1.1.2 Thu Jun 03 18:57:33 MDT 2010 plunky Update pcc to current [0.9.9 20100603] version. There have been many bugfixes and feature additions, full changelog is below. The major feature I think was the GCC compatibility which is now enabled by default, with many of the commonly used GCC attributes and builtin functions now supported, and pcc defines __GNUC__ as version 4.3 This version can build all of bin/, sbin/ and games/ except for dab(5), with only a few outstanding issues in usr.bin/ and usr.sbin/. There are still issues with PIC code generation (affects building libraries, on i386 at least) and I have not tried applying pcc to kernel builds. ChangeLog, in most-recent first order, screen-scraped from http://pcc.ludd.ltu.se/fisheye/changelog/pcc Each paragraph is a separate commit, the [xxx] refers to the module that the following commits were in: [ccom] Fix designated initializer bug as reported by Iain Hibbert on pcc-list. Put in prototype for dainit() to avoid warnings when using yacc. Discard parameter attributes, they ended up to be handled as arguments otherwise. Suppose to fix Jira#PCC-132 by Iain Hibbert. Rewrite __builtin_offsetof() to handle non-constant array offset values. This actually made the offsetof code much simpler. Requested by Iain Hibbert on pcc-list. Op DOT will be BINODE. Support gcc ugly construction a?:b, as discussed on pcc-list. Add gcc compat range initializers, reported by Iain Hibbert. [amd64] Do not put eax as hidden argument if not needed. Better support for the Intel addressing modes. Now ByteBench only takes 77% of the earlier time to complete. [mip] Do not base hash functions on memory addresses. These addresses may change between different compilations and we want predictability. Also check if an address of a node is lower than expected to avoid short-range temporaries in the Freeze() code. [i386] Clear flags field on TEMP nodes so that function pointers will get their stack adjusted afterwards, otherwise there might be junk left. [ccom] Aet alignment to at least ALCHAR for structs when passing them over to pass2. Failure to do so caused bug spotted by Iain Hibbert. [sparc64] Fix string init bug, from Lars Zetterlund. [mip] Declare printip2() as static function for whole file, as pointed out by Iain Hibbert. [ccom] Make the canary value on stack volatile, so that the compiler won't try to put it into a register. Solves stack overwrite error reported by Iain Hibbert on pcc-list. [i386] Fix uninitialized member bug in picsymtab breaking -k -g. Suppose to fix Jira#PCC-138 by Nicolas Joly, patch provided by Iain Hibbert. [ccom] Tell scan to ignore typedefs of the same names goto labels. Fixes Jira#PCC-141 by Andreas Kaiser with recommended fix from him. [mip] Run deljumps again after the ssa pass to cleanup the code before doing register allocation. [mip] Do liveness analysis before turning a function into SSA code, and later use that to to find out whether we need to insert a phi function or not. This is usually called "Pruned SSA". Now the SSA code tend to be significantly better quality. Fix deljumps label updating bug. Remove statements that are moves to itself in deljumps. [libpcc] Define _VA_LIST_DEFINED for compatibility eglibc headers. From tg@mirbsd.de. [ccom] Ensure CM towers are built to the left, fixes parsing bug pointed put by Jonathan Gray. Also add "used" attribute. [mip] Teach dce() to remove ip structs without destroying the basic block structure. [ccom] Check if type is an array before checking its dimension. Fixes bug reported by Iain Hibbert on pcc-list. [i386] Tell table to prefer 2-op insns before 3-op. Do not try to match args on builtins. [mip] Do not favorize 3-op instruction in the ssa case, simple statements like i++ have been rewritten to t1 = t2 + 1 and we want the register allocator to try to put t1 and t2 in the same register if there are 2-op insns. Help coloring algorithm by at the time of assigning registers see if there are any frozen moves to nodes that have already got their color and we can give this node the same register. This will avoid unneccessary moves. Move list init into the function that initializes it. Put two more variables into p2env, to have a cleaner way of passing information in the optimizer phase. Fix broken indentation. Do not put a move on the move list more than once. Count precolored nodes as infinite K, not 0, otherwise it may make colorable graphs uncolorable when there are many moves. [ccom] Fix reporting on bogus error of struct parameters, as reported by Iain Hibbert on pcc-list. [amd64] Remove cast of pointer converted ints, not needed on amd64. Fixes Jira#PCC-136 by Nicholas Joly. [ccom] Add and handle gcc attribute __warn_unused_result__. Requested by Iain Hibbert but with a different implementation. Do not allow initialization of multi-dimension incomplete arrays, fixes bug reported by Jesus Sanchez on pcc-list. Also fix another bug spotted, which had as a result that dynamic-sized arrays initialized by strings did not become null-terminated. [amd64] amd64 cannot handle imemdiate constants for 64-bit simple ops. Fixes Jira#PCC-134 by Nicolas Joly. [ccom] Allow any expression inside typeof. Supposes to fix Jira#PCC-135 by Iain Hibbert. [mip] Replace deljumps() with the stuff used in the 2BSD c2. Still some parts to implement though. [i386] Yech, yesterdays worst thinko about where to put the return check for floats. Now awk works again. Use SSTDCALL, not FSTDCALL for symtab entries. Spotted by Iain Hibbert. Reorganize late mangle code a little. Now stdcall should work. [mip] Remove some #if 0'ed code that is phased out. [i386] The n_flags fields should use NLOCALx defines, not hardcoded numbers. Found by Iain Hibbert. [ccom] Check for NaN string is only valid for ICON nodes. Bug found by Iain Hibbert. [i386] Detect the situation where a function returns a float number but the return value is ignored; the float stack must be popped anyway. FIxes a bug in awk where the float stack overflows. [ccom] Clear out symtab pointers for NAME and ICON nodes in functions to be inlined, since accessing them will result in crashes. Fixes stdcall/ccall bugs reported by Iain Hibbert. [ccom, i386] Add support for stdcall and cdecl attributes. Patch from iain Hibbert. [ccom] Remove redundant GETSUE() define, from Iain Hibbert. Fix yet another situation where attributes causes warnings. Reported and slightly modified patch from Iain Hibbert. Handling of argument to scalinit() was incorrect causing wrong type to be returned. Fixes Jira#PCC-131 by Iain Hibbert. Fix problem with offsetof of zero-length arrays and a debug segfault. Fixes Jira#PCC-129 by Iain Hibbert. Fix checking of struct sizes. Solves Jira#PCC-128 by Iain Hibbert. Remove redundant check that caused function names beginning with L to be treated as wide strings in __func__. Patch from Iain Hibbert. [amd64] Add last memcpy for function returning structs. Should be complete now. [configure] Set default wchar type to int instead of unsigned. [cc] Fix wchar defines as requested by Iain Hibbert. [cpp] One more comment-handling bug found by Iain Hibbert. Forgot to null-terminate yytext. Bug pointed out by Iain Hibbert. [ccom] No reason not to allow pointers larger than LONG, as pointed out by Peter Kuschnerus. Cast 0x80 to char to avoid a warning. Fixes compiler warning as reported by Peter Kuschnerus. [amd64] Add arg count index to builtin switch table. [ccom] Fix segfault bug, found and patch provided by Iain Hibbert. While here, make the switch table const. Do not segfault if the string given to __builtin_nan is a NULL pointer. Bug reported by Iain Hibbert. [ccom] Discard comments in yylex() so that -C works even with comments in #if directives. Supposes to fix Jira#PCC-126 by Iain Hibbert. Add huge/inf/nan builtins as requested by Iain Hibbert. Also add a generic builtin function, based on a slightly modified version of a patch by Iain Hibbert. Add another cast routine which will cast without adding a "cast" and therefore it will complain if it's a bad cast (like int to pointer). [amd64] Fix bugs where int should be long. Fixes Jira#PCC-125 by Nicholas Joly. [ccom] Break out buintins to their own file. Common argument count check for builtins. Should have argument cast checks here also. [i386] Add support for attribute "visibility". [amd64] Do not emit visibility type "default" since it's ``default''. Print out visibility directives for as. [ccom] Add attribute support for visibility per patch from Iain Hibbert. [i386] Add support for constructor/destructor attribute. XXX defloc() should be possible elf-common code. [amd64] Add con/destructor support. XXX pragma init/fini should be MI. [ccom] Add con/destructor as attributes per patch from Iain Hibbert. Different target implementations though. [amd64] Fix struct argument/return bugs. Add PIC support. [ccom] Change some forgotten code to find the bottom type size; since type sizes are not directly inherited anymore. Fixes coredump bug by Iain Hibbert. [cc, cpp, ccom] Fix arrows from joerg@netbsd via plunky on pcc-list. Escape some dashes and use an em-dash (noted by Thorsten). Fix broken markup in manpages (from plunky on pcc-list). [ccom] Add __builtin_memset, per patch from Iain Hibbert. [i386] Remove unused variable, as Iain Hibbert kindly informed. Remove unused (and irrelevant) statement. [ccom] Add cast() function that is an easier-to-use wrapper around buildtree(). [ccom, mip] kill some commons; ragge@ ok [cpp] Allow # alone on lines, as requested by Mickey. [ccom] Accept gcc attributes after a gcc asm() rename directive. Bugfix provided by Iain Hibbert. Supposed to fix Jira#PCC-104. Implement __builtin_memcpy(). Now pcc can compile itself again on OS X. Add support for variable renaming when assingning; i.e. int foo asm("bar") = 2; and not only int foo asm("bar"); Should fix Jira#PCC-116 by Altamiranus. Add support for attribute modes SF, DF, byte, word, pointer. Should fix Jira#PCC-114 by Altamiranus. Understand QI mode attribute as CHAR. Fixes Jira#PCC-113 by Altamiranus. Understand function attributes pure and const. Fixes Jira#PCC-110 and Jira#PCC-111 by Altamiranus. [cpp] Fix const usage. From Iain Hibbert. [mip] License (and small code) change in the code repository where the function basename() came from. From Iain Hibbert. [sparc64] Correct format strings and STASG return register. Addresses PCC-107 and PCC-108 from Dmitry Alenichev. [i386] Remove unused locals on non-openbsd builds. [cc] Don't define __GNUC__ on win32 until problems with header files are resolved. [ccom] Add my local changes for building with the Microsoft compiler. Add support for attribute mode and some mode types. Should solve Jira#PCC-101 by Detlef Riekenberg. [cpp] Print out an extra \n before emitting a new line-file directive. Solves Jira#PCC-97 by Gregory McGarry. [ccom] Add gcc attribute nothrow as patch in Jira#PCC-102 by Detlef Riekenberg. [cpp] Understand gcc directive #include_next. Solves Jira#PCC-106 by Altamiranus. [ccom] Handle more cases of attribute. Adds another shift/reduce conflict. Understand malloc attribute and ignore it, we do not do aliasing yet. Handle sizes of pointers to forward declarated strust/unions better. [i386] Print out constants in the same radix as gcc, to simplify debugging. Correct return values of STASG. [mip] STASG must be treaded as ASSIGN in sanity checks. [i386, amd64] generate symbol types and section attributes for elf; ragge@ ok [ccom] Ueck, forgot some debug printouts :-( Handling of attribute strings was broken; they were treated as names. Reported by Michael Shalayeff who provided a diff, but fixed in a more common way. [i386] Fix bug causing comparision of two long-long values to sometimes fail (low-order values must be compared unsigned). Reported by Jonathan Gray. Also fix a bug in struct assignment causing broken code to be generated. [cc] Get GCC_COMPAT from configure. At last - defined __GNUC__ etc. and also __GNUC_STDC_INLINE__. [mip] Only try to shortcut the conditional code generation if the operands are of types +-*/%&|^>><<, otherwise side effects may be lost. Bug found by Jonathan Gray. [ccom] Add the g77 types, for compatibility. [amd64] Give 32-bit register to movl instruction. Fixes Jira#PCC-100 by Dara Hazeghi. Allow moving of TEMPs to regs. Fixes Jira#PCC-99 by Dara Hazeghi. [sparc64] Sparc64 patches from Lars Zetterlund. Are supposed to fix Jira#PCC-20. [ccom] Add __builtin_offset(), which is becoming more and more common. Suggedted by Jonathan Gray. [csu] Use 'test -f' rather than 'test -e' for improved portability. From Adam Hoka. [powerpc] Improve alignment. [linux] Improve building of shared libraries on linux. Tested on Ubuntu 8.04. [libpcc] Remove definition of off_t, since it is frequently wrong. Confirmed OK on Ubuntu 8.04, OSX and Win32. [i386] Fix alignments on OSX. [tests] Get test to work on win32. Don't use __attribute__ in this test, since most systems will define it away if not gcc. [mip] Change static array to allocated linked list for temporaries not allowed to be spilled. libssl seems to make a heavy use of extended assembler. Bug reported by Jonathan Gray. [i386] dd support for gcc xasm arg types I, J, K, L, M, N. Fixes Jira#PCC-96 by Jonathan Gray. [ccom] kill unused variables; ragge@ ok [hppa] fix merge error [ccom] Put back nocon_e, creates better yacc code. [hppa] fixx fallout form walkf() change and other gcc bitchings add pragma support (from amd64 ;) [powerpc, i386, arm, amd64, mips] Return to the text segment after putting reference in constructor table. Should fix PCC-65. [ccom] Rearrange yacc code slightly to avoid a shift/reduce conflict, that could cause unwanted syntax errors. Giving multiple declarations of the same prototype failed if there were dynamic arrays as arguments. Fix bug in debug printout of prototype parameters. Accept [*] as [] in prototypes. Fixes Jira#PCC-94 by Jonathan Gray. [mip] Must add moves before and after a +r xasm directive even if the node is in a temporary; the temporary may need to be spilled. |
Completed in 599 milliseconds