[Patch,AVR]: avr.md code clean-up

2012-01-30 Thread Georg-Johann Lay
This is code clean-up for avr.md. * It resolves all AS1 and AS2 macros for string insertion. There are plan strings now and no more needed because: * All deprecated "* quoted-c-code" transformed to { c-code }. so that avr.md matches http://gcc.gnu.org/backends.html now, i.e. no 'b' in the a

Re: [Patch,wwwdocs,AVR]: AVR release notes

2012-01-30 Thread Georg-Johann Lay
Gerald Pfeifer wrote: > On Fri, 20 Jan 2012, Georg-Johann Lay wrote: >> Adding AVR-specific release notes to wwwdocs/htdocs/gcc-4.7/changes.html > > Index: changes.html > === > +The AVR port's libgcc

Re: [Patch] PR51374: combine.c and volatile correctness

2012-01-30 Thread Georg-Johann Lay
Richard Sandiford wrote: > Georg-Johann Lay writes: >> This patch fixes PR51374 by more strictly updating mem_last_set. >> Sloppy handling of mem_last_set can lead to error in volatile correctness >> because combine then is allowed to drag one volatile access over an ot

Re: [Patch] PR51374: combine.c and volatile correctness

2012-01-30 Thread Georg-Johann Lay
Richard Sandiford schrieb: Georg-Johann Lay writes: Attached you find a new, tentative patch. It resolves the issue in my small test program. However, I think someone with more insight into combine should take over the patch. OK, point taken :-) If you'd prefer someone else to appro

Re: [Patch,wwwdocs,AVR]: AVR release notes

2012-01-30 Thread Georg-Johann Lay
Weddington, Eric schrieb: From: Georg-Johann Lay Attached an updated patch as there were many changes and so that Eric and Denis can easier catch up. Hi Johann, Comments: In the first hunk of the patch, you say that libgcc has been improved and enhanced. Can you elaborate just a little in

[AVR,testsuite,trunk,4.6,committed]: Add test case for PR51374.

2012-02-01 Thread Georg-Johann Lay
http://gcc.gnu.org/viewcvs?view=revision&revision=183796 http://gcc.gnu.org/viewcvs?view=revision&revision=183797 Johann

Ping #1: [Patch,testsuite]: Fix testcase that bangs long and int against void*

2012-02-01 Thread Georg-Johann Lay
http://gcc.gnu.org/ml/gcc-patches/2012-01/msg01502.html Georg-Johann Lay wrote: > Jakub Jelinek wrote: >> On Fri, Jan 13, 2012 at 07:40:59PM +0100, Georg-Johann Lay wrote: >>> The ilp32 is the closes match: >>> >>> The source casts pointer to int, int

Re: Ping #1: [Patch,testsuite]: Fix testcase that bangs long and int against void*

2012-02-01 Thread Georg-Johann Lay
Jakub Jelinek wrote: > On Wed, Feb 01, 2012 at 02:00:53PM +0100, Georg-Johann Lay wrote: >>> * gcc.dg/lto/20091013-1_1.c: xfail for avr. >>> * gcc.dg/lto/20091013-1_2.c: xfail for avr. > > If it is just because of the warnings, can't you > add > -W

Re: [wwwdocs] Add section on diagnostics conventions

2012-02-01 Thread Georg-Johann Lay
Diego Novillo wrote: > > This is the first of a few patches to update GCC's documentation with > the proposed conventions in the GCC Development Conventions document > that Joseph and I published last year > (https://docs.google.com/a/google.com/document/pub?id=10LO8y0YhjlKHya_PKM3jEGrJu0rllv-Nc9q

[Patch,AVR]: Clean up hard-coded SFR addresses

2012-02-03 Thread Georg-Johann Lay
This patch removes the define_constants from avr.md: SREG_ADDR, SP_ADDR, RAMPZ_ADDR. The constants were not used in md directly and didn't take care of afr_offset between RAM and I/O address. The replacement is a new structure avr_addr that holds RAM addresses of respective SFRs and takes into ac

Re: [Patch,AVR]: Clean up hard-coded SFR addresses

2012-02-03 Thread Georg-Johann Lay
This patch removes the define_constants from avr.md: SREG_ADDR, SP_ADDR, RAMPZ_ADDR. The constants were not used in md directly and didn't take care of afr_offset between RAM and I/O address. The replacement is a new structure avr_addr that holds RAM addresses of respective SFRs and takes into a

Re: [Patch,AVR]: Clean up hard-coded SFR addresses

2012-02-06 Thread Georg-Johann Lay
Weddington, Eric wrote: > >> -Original Message- >> From: Georg-Johann Lay [mailto:a...@gjlay.de] >> Sent: Friday, February 03, 2012 12:47 PM >> To: gcc-patches@gcc.gnu.org >> Cc: Denis Chertykov; Weddington, Eric >> Subject: [Patch,AVR]: Clean up ha

[Patch,AVR]: Built-in for non-contiguous port layouts

2012-02-13 Thread Georg-Johann Lay
This patch set removes __builtin_avr_map8 __builtin_avr_map16 built-ins and implements a built-in __builtin_avr_insert_bits instead. This has several reasons: * From user feedback I learned that speed matters more than size here * I found that the new built-in has better usability and fits bette

Re: [Patch,AVR]: Built-in for non-contiguous port layouts

2012-02-14 Thread Georg-Johann Lay
Weddington, Eric wrote: > >> >> This patch set removes __builtin_avr_map8 __builtin_avr_map16 >> built-ins and implements a built-in __builtin_avr_insert_bits instead. >> > > In your avr_fold_builtin function you have switch (fcode) with only one > case (and a "default" that just breaks). Are you

[Patch,AVR] Add xmega support

2012-02-14 Thread Georg-Johann Lay
This patch adds support for xmega cores and does the following: * Add architectures avrxmega2/4/5/6/7 to avr-devices.c * Add some xmega MCUs to avr-mcus.def * Add new function avr.c:avr_out_movhi_mr_r_xmega that works similar to out_movhi_mr_r except that the low byte is output first. Ration

Re: [Patch,AVR] Add xmega support

2012-02-14 Thread Georg-Johann Lay
Weddington, Eric schrieb: This patch adds support for xmega cores and does the following: Please commit. And thanks! :-) Eric As I wrote, the device <-> core assignments are the same as in ./gas/config/tc-avr.c: http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/config/tc-avr.c?rev=1.79&co

Re: Ping #1: [Committed,testsuite]: Fix testcase that bangs long and int against void*

2012-02-15 Thread Georg-Johann Lay
Georg-Johann Lay wrote: > Jakub Jelinek wrote: >> On Wed, Feb 01, 2012 at 02:00:53PM +0100, Georg-Johann Lay wrote: >>>>* gcc.dg/lto/20091013-1_1.c: xfail for avr. >>>>* gcc.dg/lto/20091013-1_2.c: xfail for avr. >> If it is just because of the wa

[Patch,AVR]: Fix missing prototype warning for ACCUMULATE_OUTGOING_ARGS

2012-02-15 Thread Georg-Johann Lay
Some parts outside the backend use ACCUMULATE_OUTGOING_ARGS without including tm_p.h which lead to a build warning because avr.h does #define ACCUMULATE_OUTGOING_ARGS avr_accumulate_outgoing_args() This patcs moved the prototype from avr-protos.h to avr.h: * config/avr/avr-protos.h (avr_

Re: [Patch,wwwdocs,AVR]: AVR release notes

2012-02-15 Thread Georg-Johann Lay
Gerald Pfeifer wrote: > Looks good! Please fix the one typo, and consider the other comments > as well, and go ahead and commit this I'd say. We can always make > further changes later. Committed with the following changes: * Support for XMEGA cores * Mini-example for address space code. http

Re: [Patch,wwwdocs,AVR]: AVR release notes

2012-02-15 Thread Georg-Johann Lay
Georg-Johann Lay wrote: > http://gcc.gnu.org/gcc-4.7/changes.html > > But there is a problem with the link to built-ins in onlinedocs. > > The HTML reads > > Support for AVR-specific href="http://gcc.gnu.org/onlinedocs/gcc/AVR-Built_002din-Functions.html";>b

[Patch,AVR]: Add builtins.def and fix some ICE, add tests

2012-02-15 Thread Georg-Johann Lay
This patch introduces a new file builtins.def that is used as central registry to hold built-ins' information. The file is used by defining DEF_BUILTIN macre and then including the file as described in the head comment of builtins.def. Up to here it's all code clean-up and no functional change.

[Patch,AVR]: Tweak neghi2, add some peephole

2012-02-16 Thread Georg-Johann Lay
neghi2's "r,0" alternative reads com %B0 neg %A0 sbc %B0,__zero_reg__ inc %B0 The INC commutates with the NEG+SBC and can be moved 2 instructions up: com %B0 inc %B0 neg %A0 sbc %B0,__zero_reg__ COM+INC can be fused to NEG: neg %B0 neg %A0 sbc %B0,__zero_reg__ with the additional benefit that

[wwwdocs,committed]: Update backends.html to match avr backend

2012-02-17 Thread Georg-Johann Lay
Committed the following to backends.html: -m : The port *does* use define_constants +b : Port does not use "* ..." notation for output template code +g : Port does not define TARGET_ASM_FUNCTION_(PRO|EPI)LOGUE Johann Index: backends.html =

[Patch,AVR] Fix/hack around spill fail ICE PR52148

2012-02-17 Thread Georg-Johann Lay
Spill failure PR52148 occurs for movmem insn that allocates 2 of AVR's 3 pointer registers. Register allocator is at it's limits and the patch tries to cure the situation by replacing (match_operand:HI 0 "register_operand" "x") with explicit (reg:HI REG_X) and similar for Z Register classes "x"

[testsuite,committed]: Fix FAIL on 16-bit int platforms.

2012-02-20 Thread Georg-Johann Lay
http://gcc.gnu.org/viewcvs?view=revision&revision=184393 http://gcc.gnu.org/viewcvs?view=revision&revision=184394 Index: gcc.c-torture/execute/pr52286.c === --- gcc.c-torture/execute/pr52286.c (revision 184393) +++ gcc.c-torture/e

[Patch,AVR]: Fix PR50063 GCC does not support FP = SP

2012-02-21 Thread Georg-Johann Lay
This is a tentative patch to the PR. As Jakub explained, GCC does not support configurations with FP = SP and DSE optimizer generates wrong code for AVR. This patch implements Jakub's proposal to hack around by hiding the action of setting/moving between SP and SP into UNSPEC[_VOLATILE]s. All wor

[testsuite,AVR,committed]: Add test case for PR middle-end/51782

2012-02-21 Thread Georg-Johann Lay
http://gcc.gnu.org/viewcvs?view=revision&revision=184434 testsuite/ PR middle-end/51782 * gcc.target/avr/torture/pr51782-1.c: New test.

Re: [PATCH, PR 51782] Derive rtx address space from base object

2012-02-21 Thread Georg-Johann Lay
on a cross compiler, a bootstrap and > testsuite run on x86_64-linux showed only regressions described in PR > 52297 so I consider it successful. My understanding is that Richi > approved it in bugzilla. Georg-Johann Lay said he would test it on HW > or simulator that actually uses ad

Re: [Patch,AVR]: Fix PR50063 GCC does not support FP = SP

2012-02-21 Thread Georg-Johann Lay
Jakub Jelinek wrote: > On Tue, Feb 21, 2012 at 12:38:48PM +0100, Georg-Johann Lay wrote: >> However, if all insns that are involved in SP/FP manipulation get the >> RTX_FRAME_RELATED_P, almost every test case that has -g crashes with this >> dwarf-ICE. > > My sugges

[Patch,AVR,4.6]: Fix PR50063 GCC does not support FP = SP

2012-02-22 Thread Georg-Johann Lay
Denis Chertykov wrote: > 2012/2/21 Richard Henderson: >> On 02/21/12 09:08, Georg-Johann Lay wrote: >>> PR rtl-optimization/50063 >>> * config/avr/avr.md (movhi_sp_r): Handle -1 (unknown IRQ state) >>> and 2 (8-bit SP) in ope

Re: [Patch,AVR,4.6]: Fix PR50063 GCC does not support FP = SP

2012-02-22 Thread Georg-Johann Lay
Richard Guenther wrote: > On Wed, Feb 22, 2012 at 11:39 AM, Georg-Johann Lay wrote: >> Denis Chertykov wrote: >>> 2012/2/21 Richard Henderson: >>>> On 02/21/12 09:08, Georg-Johann Lay wrote: >>>>> PR rtl-optimization/50063 >>>>>

[Patch,AVR,committed] PR18145 addendum: Don't trigger __do_clear_bss for lto markers

2012-02-22 Thread Georg-Johann Lay
http://gcc.gnu.org/viewcvs?view=revision&revision=184481 Committed to make dragging in startup code more precise. Objects named like __gnu_lto_slim are just markers for the LTO machinery; there is no need to trigger startup code for them, see also http://gcc.gnu.org/ml/gcc/2012-02/msg00391.html

Re: [Patch,AVR]: Fix missing prototype warning for ACCUMULATE_OUTGOING_ARGS

2012-02-22 Thread Georg-Johann Lay
Denis Chertykov wrote: > 2012/2/15 Georg-Johann Lay: >> Some parts outside the backend use ACCUMULATE_OUTGOING_ARGS without including >> tm_p.h which lead to a build warning because avr.h does >> >> #define ACCUMULATE_OUTGOING_ARGS avr_accumulate_outgoing_args()

[Patch,AVR]: Make flash size a device property (was: core property)

2012-02-22 Thread Georg-Johann Lay
This patch addresses several issues related to device flash size: * cores avrxmega4/5 have ELPM* instruction * flash sizes for xmega were wrong because atxmegaXX has some extra bootloader flash and thus a flash size of XX + epsilon. * There are devices with different flash sizes, i.e. with

[Patch,AVR]: Tweak xor similar to ior

2012-02-23 Thread Georg-Johann Lay
This mini-patch extends some combine patterns that used IOR to also match for XOR in a similar way. Bottom line is always that when performing IOR or XOR, only portions in non-zero bytes matter and zero-bytes that come from zero-extends or shifts need not to be XORed/IORed. The patch just replace

Ping #1: [Patch,AVR] Fix/hack around spill fail ICE PR52148

2012-02-24 Thread Georg-Johann Lay
http://gcc.gnu.org/ml/gcc-patches/2012-02/msg00956.html Georg-Johann Lay wrote: > Spill failure PR52148 occurs for movmem insn that allocates 2 of AVR's 3 > pointer registers. Register allocator is at it's limits and the patch tries to > cure the situation by replacing >

Ping #1: [Patch,AVR]: Add builtins.def and fix some ICE, add tests

2012-02-24 Thread Georg-Johann Lay
http://gcc.gnu.org/ml/gcc-patches/2012-02/msg00843.html Georg-Johann Lay wrote: > This patch introduces a new file builtins.def that is used as central registry > to hold built-ins' information. > > The file is used by defining DEF_BUILTIN macre and then including the file as &

Re: Ping #1: [Patch,AVR] Fix/hack around spill fail ICE PR52148

2012-02-25 Thread Georg-Johann Lay
Denis Chertykov schrieb: 2012/2/24 Georg-Johann Lay: http://gcc.gnu.org/ml/gcc-patches/2012-02/msg00956.html Georg-Johann Lay wrote: Spill failure PR52148 occurs for movmem insn that allocates 2 of AVR's 3 pointer registers. Register allocator is at it's limits and the patch tri

Re: [Patch,AVR]: Make flash size a device property (was: core property)

2012-02-25 Thread Georg-Johann Lay
Georg-Johann Lay schrieb: This patch addresses several issues related to device flash size: * cores avrxmega4/5 have ELPM* instruction * flash sizes for xmega were wrong because atxmegaXX has some extra bootloader flash and thus a flash size of XX + epsilon. * There are devices with

[Patch,AVR]: ASM_SPEC: Add -mno-skip-bug

2012-02-28 Thread Georg-Johann Lay
This patch is addendum to support skip of 2-word instructions as of PR49939 and the extension made in http://gcc.gnu.org/viewcvs?view=revision&revision=177049 gas emits a warning if it sees a skip of 2-word instruction for cores that might have the skip bug. However, only specific devices are aff

[Patch,AVR]: Tweak decrement-and-branch peepholes

2012-02-29 Thread Georg-Johann Lay
The condition/branch in decrement-and-branch peepholes is ne/brcc. This can be generalized to cover eq/brcs. Tested without regressions. Because of PR52417, I had to run the tests with -fno-dse. There is one UNSUPPORTED because of that (missing dse dump). Ok for the trunk? Johann * co

[Patch,AVR] Clean-up: Move TARGET macros to end of avr.c

2012-02-29 Thread Georg-Johann Lay
This patch moves the bulk of TARGET_* macros to the end of avr.c and just prior to their usage by TARGET_INITIALIZER to initialize targetm. It's just more convenient to have that bulk of code at the end of the file... Ok to commit? Johann * config/avr/avr.c: Move definition of TARGET m

[Patch,AVR]: Clean-up printing bits

2012-02-29 Thread Georg-Johann Lay
This is more of code clean-up: avr_output_bld is unused and can be removed. To print a bit it is more convenient to use %T than patching a string. Ok for trunk? Johann * config/avr/avr-protos.h (avr_output_bld): Remove unused prototype. * config/avr/avr.c (avr_output_bld): Remove

[Patch,AVR]: Add built-in to get flash segment

2012-03-01 Thread Georg-Johann Lay
This built-in basically returns the high byte of a 24-bit address. It can be used to test at run time where a pointer points to (Flash or RAM). Ok for trunk? Johann * doc/extend.texi (AVR Built-in Functions): Document __builtin_avr_flash_segment. * config/avr/builtins.d

[Patch,AVR] PR52461: Fix RAMPZ clobbering and RAMP* in epilogue

2012-03-04 Thread Georg-Johann Lay
This patch fixes several issues with RAMP registers: * On Devices with more than 64 KiB RAM, RAMPZ is used as high-byte of RAM address. If RAMPZ is used to read flash, it must be reset to 0 after the read so that RAM-read will operate correctly in the remainder. There is no support for RAM >

[Patch,AVR]: Tweak a+2*b

2012-03-04 Thread Georg-Johann Lay
This patch adds a straight forward combine pattern and split for int + 2*byte as frequently seen with accesses to int-arrays with byte offset. Ok for trunk? Johann * config/avr/avr.md (*umaddqihi4.2): New insn-and-split. Index: config/avr/avr.md ==

Re: [Patch,AVR] PR52461: Fix RAMPZ clobbering and RAMP* in epilogue

2012-03-05 Thread Georg-Johann Lay
Georg-Johann Lay wrote: > This patch fixes several issues with RAMP registers: > > * On Devices with more than 64 KiB RAM, RAMPZ is used as high-byte of > RAM address. If RAMPZ is used to read flash, it must be reset to 0 > after the read so that RAM-read will operate c

[Patch,AVR]: Document -mmcu=avrxmega...

2012-03-05 Thread Georg-Johann Lay
This patch adds the documentation for -mmcu= for xmega cores that is still missing. Moreover, there is some explanation of RAMP SFR usage. Ok for the trunk and 4.7? Johann * doc/invoke.texi (AVR Options): -mmcu=: Document the XMEGA cores. Explain RAMPD, RAMPX, RAMPDY, RAMPZ usa

Re: [Patch,AVR] PR52461: Fix RAMPZ clobbering and RAMP* in epilogue

2012-03-05 Thread Georg-Johann Lay
Richard Guenther wrote: > All commits to the 4.7 branch need explicit release manager approval. AVR > isn't primary/secondary so please do not change anything before is > released 4.7.0 for it. > > Thanks, > Richard. What is the exact procedure in that case? Wait until approve from release mana

Re: [Patch,AVR,trunk,4.7] PR52461: Fix RAMPZ clobbering and RAMP* in epilogue

2012-03-05 Thread Georg-Johann Lay
Richard Guenther wrote: > On Mon, Mar 5, 2012 at 4:25 PM, Georg-Johann Lay wrote: >> Richard Guenther wrote: >> >>> All commits to the 4.7 branch need explicit release manager approval. AVR >>> isn't primary/secondary so please do not change anythi

Re: [Patch,AVR,trunk,4.7] PR52461: Fix RAMPZ clobbering and RAMP* in epilogue

2012-03-05 Thread Georg-Johann Lay
Richard Guenther wrote: > On Mon, Mar 5, 2012 at 4:56 PM, Georg-Johann Lay wrote: >> Richard Guenther wrote: >>> On Mon, Mar 5, 2012 at 4:25 PM, Georg-Johann Lay wrote: >>>> Richard Guenther wrote: >>>> >>>>> All commits to the 4.7 branch

Re: [Patch,AVR,trunk,4.7] PR52461: Fix RAMPZ clobbering and RAMP* in epilogue

2012-03-05 Thread Georg-Johann Lay
Richard Guenther wrote: > On Mon, Mar 5, 2012 at 6:15 PM, Georg-Johann Lay wrote: >> Richard Guenther wrote: >>> On Mon, Mar 5, 2012 at 4:56 PM, Georg-Johann Lay wrote: >>>> Richard Guenther wrote: >>>>> On Mon, Mar 5, 2012 at 4:25 PM, Georg-Joh

Re: [Patch,AVR]: Document -mmcu=avrxmega...

2012-03-05 Thread Georg-Johann Lay
Georg-Johann Lay schrieb: This patch adds the documentation for -mmcu= for xmega cores that is still missing. Moreover, there is some explanation of RAMP SFR usage. Ok for the trunk and 4.7? This patch is just for trunk, not for 4.7 Johann * doc/invoke.texi (AVR Options): -mmcu

Re: [Patch,AVR,trunk,4.7] PR52461: Fix RAMPZ clobbering and RAMP* in epilogue

2012-03-06 Thread Georg-Johann Lay
Richard Guenther wrote: > On Mon, Mar 5, 2012 at 6:54 PM, Georg-Johann Lay wrote: >> Richard Guenther wrote: >>> On Mon, Mar 5, 2012 at 6:15 PM, Georg-Johann Lay wrote: >>>> Richard Guenther wrote: >>>>> On Mon, Mar 5, 2012 at 4:56 PM, Georg-Joh

[Patch,AVR]: Fix PR52506

2012-03-06 Thread Georg-Johann Lay
The problem is that RAMPD/X/Y/Z are restored in the wrong order in ISR epilogue. Ok for trunk? Johann PR target/52506 * gcc/config/avr/avr.c (expand_epilogue): Fix order of restoration to: RAMPZ, RAMPY, RAMPX, RAMPD. (expand_prologue): Only clear RAMPZ if it has e

[Patch,AVR]: Fix PR52507

2012-03-06 Thread Georg-Johann Lay
This fixes a wrong loop label in the movmemhi worker for the __memx address space case. Ok for trunk? Johann PR target/52507 * config/avr/lib1funcs.S (__movmemx_hi): Fix loop label in RAM-part. Index: libgcc/config/avr/lib1funcs.S =

[Patch,AVR] Fix PR52505

2012-03-06 Thread Georg-Johann Lay
This is fix for __memx address space reads that might read from RAM or flash. For flash reads, never read from RAM so that I/O latches don't get read out unintentionally. Ok for trunk? Johann libgcc/ PR target/52505 * config/avr/lib1funcs.S (__xload_1): Don't read unintentionally

[Patch,AVR]: Fix PR52496: Add memory barriers to built-ins

2012-03-07 Thread Georg-Johann Lay
This patch adds memory barriers to __builtin_avr_nop __builtin_avr_sei __builtin_avr_cli __builtin_avr_wdr __builtin_avr_sleep __builtin_avr_delay_cycles so that their code cannot be dragged over memory accesses. Ok for trunk? PR target/52496 * config/avr/avr.c (avr_mem_clobber)

[Patch,AVR,committed]: Fix PR52484

2012-03-07 Thread Georg-Johann Lay
http://gcc.gnu.org/viewcvs?view=revision&revision=185043 This wrong code bug for __memx space was caused by a missing R22 in the register footprint of xload_A split. Johann PR target/52484 * config/avr/avr.md (xload_A): Add R22... to register footprint. Index: config/avr/avr.md

[Patch,AVR]: Add "w" constraint alternative to addhi3

2012-03-08 Thread Georg-Johann Lay
This patch adds a "w" alternative to *addhi3 and addhi3_clobber in order to vote for class "w". This is similar to the orgiginal addhi3 insn up to version 4.6. And there is no more explicit vote for "l" in addhi3_clobber, it's just "r". Intention is to get a better usage of ADIW and SBIW instruc

[Patch, AVR, 4.6] PR target/44643

2011-05-26 Thread Georg-Johann Lay
This is a straight forward 4.7 -> 4.6 backport for PR44643 http://gcc.gnu.org/ml/gcc-patches/2011-04/msg00544.html http://gcc.gnu.org/viewcvs?view=revision&revision=172415 Johann PR target/44643 * config/avr/avr.c (avr_insert_attributes): Leave TREE_READONLY alone. Error if non-

[Patch, 4.6, AVR]: Fix PR45263

2011-05-27 Thread Georg-Johann Lay
Georg-Johann Lay schrieb: > Georg-Johann Lay schrieb: >> Georg-Johann Lay schrieb: >>> Weddington, Eric schrieb: >>>>> -Original Message- >>>>> From: Georg-Johann Lay [mailto:a...@gjlay.de] >>>>> Sent: Friday, April 01

Re: [Patch,AVR]: Solve PR42210

2011-05-28 Thread Georg-Johann Lay
Georg-Johann Lay wrote: Georg-Johann Lay wrote: Richard Henderson wrote: Why are you adding "optimize" to all these insns? None of them will be matched unless combine is run, which implies optimization. Here is a patch without optimize in the insn conditions. The optimize co

[testsuite]: Skip tests for targets with int < 32 bits

2011-06-09 Thread Georg-Johann Lay
This patch fixes testsuite failures because the testcases assume sizeof(int) >= 4. * gcc.c-torture/compile/pr49029.c: Add dg-require-effective-target int32plus * gcc.c-torture/compile/pr49163.c: Ditto. Index: gcc.c-torture/compile/pr49029.c =

[Patch, AVR]: Fix PR46779

2011-06-09 Thread Georg-Johann Lay
This is a tentative patch to fix PR46779 and hopefully also related issues like PR45291. In the present version of avr_hard_regno_mode_ok, QImode is forbidden in r29/r28. If a 16-bit value or composite is allocated to r28, this can lead to odd subregs like (set (subreg:QI (reg:HI r28) 0) ...) Th

[Patch, AVR]: Fix thinko in avr_function_arg_advance

2011-06-09 Thread Georg-Johann Lay
This patch fixes a thinko in avr_function_arg_advance. Without the patch, following code will report false positive for passing args in fixed regs like: error: Register r0 is needed to pass a parameter but is fixed error: Register r1 is needed to pass a parameter but is fixed This is the code:

Re: [Patch, AVR]: Fix PR46779

2011-06-09 Thread Georg-Johann Lay
Denis Chertykov schrieb: > 2011/6/9 Georg-Johann Lay : >> This is a tentative patch to fix PR46779 and hopefully also related >> issues like PR45291. >> > - /* Disallow QImode in stack pointer regs. */ > - if ((regno == REG_SP || regno == (REG_SP + 1)) && mod

Re: [Patch, AVR]: Fix PR46779

2011-06-09 Thread Georg-Johann Lay
Georg-Johann Lay schrieb: Denis Chertykov schrieb: 2011/6/9 Georg-Johann Lay : This is a tentative patch to fix PR46779 and hopefully also related issues like PR45291. - /* Disallow QImode in stack pointer regs. */ - if ((regno == REG_SP || regno == (REG_SP + 1)) && mode =

Re: [Patch, AVR]: Fix PR46779

2011-06-10 Thread Georg-Johann Lay
Denis Chertykov schrieb: > 2011/6/9 Georg-Johann Lay : >> This is a tentative patch to fix PR46779 and hopefully also related >> issues like PR45291. >> > - /* Disallow QImode in stack pointer regs. */ > - if ((regno == REG_SP || regno == (REG_SP + 1)) && mod

Re: [Patch, AVR]: Fix PR46779

2011-06-10 Thread Georg-Johann Lay
Denis Chertykov schrieb: > 2011/6/9 Georg-Johann Lay : >> Denis Chertykov schrieb: >>> 2011/6/9 Georg-Johann Lay : >> I agree with you. However, I think that the risk of spill failure >> should be minimized. I have no idea how to fix a splill failure like >> th

Ping: [testsuite]: Skip tests for targets with int < 32 bits

2011-06-13 Thread Georg-Johann Lay
Ping #1 for: http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00746.html Georg-Johann Lay: This patch fixes testsuite failures because the testcases assume sizeof(int) >= 4. * gcc.c-torture/compile/pr49029.c: Add dg-require-effective-target int32plus * gcc.c-tort

Re: [Patch, AVR]: Fix PR46779

2011-06-13 Thread Georg-Johann Lay
[In CCing Richard Henderson] Denis Chertykov schrieb: 2011/6/10 Georg-Johann Lay : Then I have a question on spill failures: There is PR46278, an optimization flaw that goes as follows: The avr BE defines fake addressing mode X+const that has to be written down in asm as X += const a = *X X

Re: [testsuite]: Skip tests for targets with int < 32 bits

2011-06-13 Thread Georg-Johann Lay
Mike Stump schrieb: On Jun 9, 2011, at 9:27 AM, Georg-Johann Lay wrote: This patch fixes testsuite failures because the testcases assume sizeof(int) >= 4. * gcc.c-torture/compile/pr49029.c: Add dg-require-effective-target int32plus * gcc.c-torture/compile/pr4916

Re: [testsuite]: Skip tests for targets with int < 32 bits

2011-06-14 Thread Georg-Johann Lay
Jakub Jelinek schrieb: > On Mon, Jun 13, 2011 at 08:18:52PM +0200, Georg-Johann Lay wrote: >> For exammple, I added this line to, e.g. >> * gcc.c-torture/execute/cmpsi-2.c >> * gcc.c-torture/execute/pr45262.c >> in trunk r172757 >> http://gcc.gnu.org/viewcvs?view=r

Re: [Patch, AVR]: Fix PR46779

2011-06-14 Thread Georg-Johann Lay
Denis Chertykov schrieb: > 2011/6/13 Georg-Johann Lay : >> So you think is is pointless/discouraged to give a more realistic >> description of AVR addressing be means of MODE_CODE_BASE_REG_CLASS (instead >> of BASE_REG_CLASS) resp. REGNO_MODE_CODE_OK_FOR_BASE_P? >

Re: [Patch, AVR]: Fix PR46779

2011-06-14 Thread Georg-Johann Lay
Denis Chertykov schrieb: 2011/6/14 Georg-Johann Lay : Denis Chertykov schrieb: 2011/6/13 Georg-Johann Lay : So you think is is pointless/discouraged to give a more realistic description of AVR addressing be means of MODE_CODE_BASE_REG_CLASS (instead of BASE_REG_CLASS) resp

Re: [Patch, AVR]: PR49313, fix PR29524

2011-06-15 Thread Georg-Johann Lay
Denis Chertykov schrieb: > 2011/6/15 Georg-Johann Lay : >> This is a patch that implements some libgcc functions in assembler. >> The functions are used only very seldom but if, they lead to an >> unpleasant waste of resource. For example, some SF functions >> eventua

Re: [Patch, AVR]: Hack around PR34734

2011-06-15 Thread Georg-Johann Lay
) Someone will have to dive into C++ FE/parser. Johann > > Eric Weddington > >> -Original Message- >> From: Georg-Johann Lay [mailto:a...@gjlay.de] >> Sent: Wednesday, June 15, 2011 3:26 PM >> To: gcc-patches@gcc.gnu.org >> Cc: Weddington, Eric; Anat

Re: [Patch, AVR]: Fix PR46779

2011-06-15 Thread Georg-Johann Lay
Richard Henderson schrieb: On 06/14/2011 02:29 PM, Georg-Johann Lay wrote: I tested on some handcrafted examples and on the code attached to PR46278. The generated code looked very good and so I started regression testing but found at spill fail in gcc.c-torture/compile/950612-1.c I

[Patch, AVR]: Hack around PR34734

2011-06-15 Thread Georg-Johann Lay
PR34734 is an annoying, false C++ warning for code like const int x __attribute__((progmem)) = 1; progmem.c:1:30: warning: only initialized variables can be placed into program memory area [enabled by default] The problem is that DECL_INITIAL is NULL at the specific point in space and time (avr_

[Patch, AVR]: PR49313, fix PR29524

2011-06-15 Thread Georg-Johann Lay
[Resent as original appears to got lost in the net] http://gcc.gnu.org/ml/gcc-patches/2011-06/msg01141.html This is a patch that implements some libgcc functions in assembler. The functions are used only very seldom but if, they lead to an unpleasant waste of resource. For example, some SF functi

[Patch, AVR]: PR49313, fix PR29524

2011-06-15 Thread Georg-Johann Lay
This is a patch that implements some libgcc functions in assembler. The functions are used only very seldom but if, they lead to an unpleasant waste of resource. For example, some SF functions eventually lead to __clz_tab being dragged in (PR29524). This patch avoids that by straight forward assem

Re: [Patch, AVR]: PR49313, fix PR29524

2011-06-16 Thread Georg-Johann Lay
Denis Chertykov schrieb: > 2011/6/15 Georg-Johann Lay : >> This is a patch that implements some libgcc functions in assembler. >> The functions are used only very seldom but if, they lead to an >> unpleasant waste of resource. For example, some SF functions >> eventua

Re: [Patch, AVR]: Hack around PR34734

2011-06-16 Thread Georg-Johann Lay
Richard Guenther schrieb: > On Wed, Jun 15, 2011 at 3:54 PM, Georg-Johann Lay wrote: Is it possible not to quote my email address? Thanks. >> Weddington, Eric schrieb: >>> Hi Johann, >>> >>> I understand your reasoning, but I'm not particularly fond of t

Re: Add __builtin_clrsb, similar to clz/ctz

2011-06-16 Thread Georg-Johann Lay
Bernd Schmidt schrieb: > Several processors have a "count redundant sign bits" instruction: > > * SIGNBITS on Blackfin > * NORM on C6X > * SBC, apparently, on picochip > > and probably others. For example, for a value of 0 or -1, it returns 31, > while e.g. an input 0xc000 produces 1. > > Ot

[Patch, AVR]: QI builtins for parity, popcount, 1<< n

2011-06-16 Thread Georg-Johann Lay
The recent implementation of some asm function in libgcc added __popcountqi2 and __parityqi2. This patch makes these functions available as __builtin_avr_popcount8 resp. __builtin_avr_parity8. Moreover, just out of a mood, I wrote a builtin for 1

Re: [Patch, AVR]: PR49313, fix PR29524

2011-06-17 Thread Georg-Johann Lay
Richard Henderson schrieb: > On 06/15/2011 02:47 AM, Georg-Johann Lay wrote: >> +#if defined (L_loop_ffsqi2) >> +;; Helper for ffshi2, ffssi2 >> +;; r25:r24 = r26 + zero_extend16 (ffs8(r24)) >> +;; r24 must be != 0 >> +;; clobbers: r26 >> +DEFUN __loop_ffsqi2

Re: [Patch, AVR]: QI builtins for parity, popcount, 1<< n

2011-06-17 Thread Georg-Johann Lay
Joseph S. Myers schrieb: > On Thu, 16 Jun 2011, Georg-Johann Lay wrote: > >> The recent implementation of some asm function in libgcc added >> __popcountqi2 and __parityqi2. This patch makes these functions >> available as __builtin_avr_popcount8 resp. __builtin_avr_parit

Re: [Patch, AVR]: PR49313, fix PR29524

2011-06-17 Thread Georg-Johann Lay
Richard Henderson schrieb: > On 06/17/2011 02:20 AM, Georg-Johann Lay wrote: >> Richard Henderson schrieb: >>> On 06/15/2011 02:47 AM, Georg-Johann Lay wrote: >> >> Yes, you are right. Following patchlet ok? >> >> Johann >> >> * config/

Re: [Patch, AVR]: QI builtins for parity, popcount, 1<< n

2011-06-17 Thread Georg-Johann Lay
Joseph S. Myers schrieb: > On Fri, 17 Jun 2011, Georg-Johann Lay wrote: > >> I don't see what's bat with the patch, it's straight forward. > > C is a high-level language, defined in terms of high-level > semantics rather than machine instructions. C code shou

Re: [Patch, AVR]: QI builtins for parity, popcount, 1<< n

2011-06-17 Thread Georg-Johann Lay
Georg-Johann Lay schrieb: > To come back to the original topic, here is a tentative patch for > better popcount and parity: > > * config/avr/t-avr (LIB1ASMFUNCS): Rename _loop_ffsqi2 to > _ffsqi2_nz. > * confif/avr/libgcc.S: Ditto. Rename __loop_ffs

[Patch, AVR]: Fix PR34734

2011-06-20 Thread Georg-Johann Lay
PR34734 produces annoying, false warnings if __attribute__((progmem)) is used in conjunction with C++. DECL_INITIAL is not yet set up in avr_handle_progmem_attribute. Johann PR target/34734 * config/avr/avr.c (avr_handle_progmem_attribute): Move warning about uninitialize

Re: [Patch, AVR]: QI builtins for parity, popcount, 1<< n

2011-06-20 Thread Georg-Johann Lay
Joseph S. Myers schrieb: > On Fri, 17 Jun 2011, Georg-Johann Lay wrote: > >> So here is my question: Would it be big deal to teach optabs to >> expand plus:di, minus:di as libcall? Maybe even compare is >> feasible? Like so: > > I don't know what the best ap

Re: [Patch, AVR]: QI builtins for parity, popcount, 1<< n

2011-06-20 Thread Georg-Johann Lay
Richard Henderson schrieb: > On 06/20/2011 07:20 AM, Georg-Johann Lay wrote: >> A libcall could be added in TARGET_INIT_LIBCALLS, so a new hook is not >> needed. All that's needed is that optabs tests for presence of such >> an entry and prefers it over inline expans

Re: Remove TARGET_HELP hook

2011-06-20 Thread Georg-Johann Lay
Joseph S. Myers schrieb: > When moving hooks used in opts.c to the common hooks structure so they > can be called from the driver, I did not move the TARGET_HELP hook > because this hook is obsoleted by the generic Enum .opt facility (only > being used to print list of enumerated arguments to optio

[Patch, AVR]: Fix PR33049 (implement extzv)

2011-06-20 Thread Georg-Johann Lay
This is an optimization patch that implements extzv for 1-bit extracts. The nice thing is that AVR can do this easily with a BLD/CLR/BST sequence, without putting pressure on d-regs and without the requirement of source being in the same register as destination. extzv can also be seen in conjunct

Re: [Patch, AVR]: Fix PR33049 (implement extzv)

2011-06-21 Thread Georg-Johann Lay
Denis Chertykov schrieb: > 2011/6/20 Georg-Johann Lay : >> This is an optimization patch that implements extzv for 1-bit extracts. > > >> +(define_insn_and_split "*extzv" >> + [(set (match_operand:QI 0 "register_operand"

[Patch, AVR]: Fix build warning in md.

2011-06-21 Thread Georg-Johann Lay
gen machinery comes up with a build warning: ../../../gcc.gnu.org/trunk/gcc/config/avr/avr.md:2763: '@' is redundant for output template with single alternative There is @ asm template selector for insn with just one alternative. This trivial patch fixes that. Johann * config/avr/avr.m

Re: [Patch, AVR]: Fix PR33049 (implement extzv)

2011-06-21 Thread Georg-Johann Lay
Denis Chertykov schrieb: > 2011/6/21 Georg-Johann Lay: >> Ok. d_register_operand or satisfies_constraint_d would do. But I >> preferred to introduce a new constraint for 4 and avoid splitting >> *extzv altogether to keep it simple. Complexity of splitting is not a &

Re: [Patch, AVR]: Fix PR33049 (implement extzv)

2011-06-21 Thread Georg-Johann Lay
Denis Chertykov schrieb: > I'm vote for 'C'. > > Denis. So it's C :-) Johann PR target/33049 * config/avr/avr.md (extzv): New expander. (*extzv): New insn. (*extzv.qihi1, *extzv.qihi2): New insn-and-split. * config/avr/constraints.md (C04): New constrain

<    5   6   7   8   9   10   11   12   13   >