Re: [avr-gcc-list] Allocating variables to a fixed address

2009-05-11 Thread Jan Waclawek
Robert, There is some difference, though: you can't count on such variables to be initialised to zero. JW - Original Message --- Schwichtenberg, Knut wrote: Robert, there is no difference in handling. So create your special section and put the variables into it as you

Re: [avr-gcc-list] Allocating variables to a fixed address

2009-05-12 Thread Jan Waclawek
I simply require a way to fix absolutely this jump table in memory. Whether I write it in C or assembler seems to me to be irrelevant, as is using an array of pointer to functions, because I still have the problem of fixing these at absolute addresses. If anyone knows a way to do this, I would

RE: [avr-gcc-list] string initialization using and { }

2009-05-27 Thread Jan Waclawek
Since it understands the concept of a string as a constant, it stores the string constant in flash and then copies it into the stack frame (your first example). Unfortunately, much worse than that. The constant initialiser is stored in initialised .data. I.e. it eats FLASH (as the .data

Re: [avr-gcc-list] string initialization using and { }

2009-05-27 Thread Jan Waclawek
-specific backend, to reduce the overhead when using initialised char-short-long. That's IMHO the place where a bit more work might bring benefit. The string initialiser *might* be a different issue, I see that. Jan Waclawek -Original Message- Note that this behaviour is only

Re: [avr-gcc-list] Problem allocating memory in xflash

2009-08-27 Thread Jan Waclawek
Parthasaradhi Nayani wrote: I have a structure prclkp of size 32 bytes. When I define struct prclkp XFLASH PLULOC1[1023]; No error is reported, whereas struct prclkp XFLASH PLULOC1[1024]; generates an error - size of array too large You've probably reached a built-in limit in gcc. It

Re: [avr-gcc-list] Problem allocating memory in xflash

2009-08-27 Thread Jan Waclawek
So, it appears to be limit of avr-gcc specifically. Sure, it depends from sizeof(int). Hummm, for me, the relationship is not quite sure. Can you explain that in more detail, please? Also, how does it imply the 32k limit on the initialiser and the lack of warning when crossed? Jan Waclawek

Re: [avr-gcc-list] Different size between .hex file and firmware size.

2010-03-18 Thread Jan Waclawek
What are these bytes ? Most probably these are initialiser values for initialised data. Have a look into the .map file. Jan Waclawek ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Re: [avr-gcc-list] Re: C aliasing rules

2010-05-19 Thread Jan Waclawek
What if instead of concetrating on this aliasing stuff you'd been already told is not pertinent to avr-gcc, you finally start to examine the compiled code? Or, post it. JW ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org

[avr-gcc-list] documenting pm() and gs() avr-as operators

2010-05-22 Thread Jan Waclawek
at http://sourceware.org/binutils/docs/as/AVR_002dModifiers.html . Thanks, Jan Waclawek ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Re: [avr-gcc-list] documenting pm() and gs() avr-as operators

2010-05-22 Thread Jan Waclawek
By filing a bug report + patch OK, so here we go again, Joerg. First, I have no idea what the source of docs is (and I suspect it is in some arcane language I would have trouble to work with anyway), where it is nor how to prepare a patch the high esteemed gnu gurus would be akin to have a

Re: [avr-gcc-list] documenting pm() and gs() avr-as operators

2010-05-22 Thread Jan Waclawek
If you don't know something, you can simply ask. Okay. What do pm() and gs() exactly do? Btw., as a stop-gap measure, we added it to the avr-libc documentation some time ago, Could you please point me at it, I can't find it. I can find a mention of pm in

Re: [avr-gcc-list] WinAVR discontinued ?!?!?

2010-06-04 Thread Jan Waclawek
http://www.avrfreaks.net/index.php?name=PNphpBB2file=viewtopict=88210highlight= JW - Original Message --- Where can I find out more about the discontinuation of WinAVR, please? Graham. - Original Message - From: Weddington, Eric eric.wedding...@atmel.com ... not

Re: [avr-gcc-list] Stack use - possible bug

2010-06-09 Thread Jan Waclawek
to disjunct blocks. I could not produce a simple testcase either, that's why I never reported it as a bug. Jan Waclawek - Original Message --- Dale wrote: Hi @2010.06.09_14:42:49_+0200 Here's some code which shows this. This code doesn't show

RE: [avr-gcc-list] Stack use - possible bug

2010-06-09 Thread Jan Waclawek
Yes, I can agree to that, but I don't know if I could fully characterize = this as a bug. Call it missed optimisation, then. JW - Original Message --- But you agree that there's stack used and never returned for reuse? =20 Yes, I can agree to that, but I don't know if I

Re: [avr-gcc-list] Stack use - possible bug

2010-06-09 Thread Jan Waclawek
are only a variation of this problem. Still I wouldn't call this a bug, but that's just terminology. Let's just call it a serious case of missed optimisation... :-) Jan Waclawek ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http

Re: [avr-gcc-list] Stack use - possible bug

2010-06-09 Thread Jan Waclawek
For -O0 it works but upgrading to -Os makes the code non functional. Indeed. The bug is present only with -O2, -O3 and -Os. -O0 and -O1 produces stack frame of expected size... I'd requalify it from missed optimisation to pessimisation, then... :-) Jan

[avr-gcc-list] avr-ld --relax bug

2010-11-13 Thread Jan Waclawek
For those who believe in reporting bugs but don't visit avrfreaks.net, http://www.avrfreaks.net/index.php?name=PNphpBB2file=viewtopicp=764532#764532 and above and below describes a yummy avr-ld bug related to --relax. I know it is not a -gcc but binutils bug, but there is no avr-binutils

RE: [avr-gcc-list] avr-ld --relax bug

2010-11-14 Thread Jan Waclawek
I know it is not a -gcc but binutils bug, but there is no avr-binutils mailing list, so where would I post this. No, but there is an official GNU Binutils website here: http://www.gnu.org/software/binutils/ Which then has a link to a bug database where you fill out a bug report. Mark the

Re: [avr-gcc-list] Bug in shift operation with avr-gcc

2011-06-07 Thread Jan Waclawek
, which yields the expected result straightforwardly. The keywords for further reading are integer promotion and usual arithmetic conversions. Enjoy! Jan Waclawek (The C-hater) ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org https://lists.nongnu.org

Re: [avr-gcc-list] May avr-gcc emit EIJMP/EICALL?

2011-10-13 Thread Jan Waclawek
The jump targets in jump tables from switch_case/.ctors/.dtors are located in lower flash and their entries are gs() and use relaxation magic to have jumping pads generated. AFAIK, the linker creates the trampoline/jumptable regardless of relaxation. It's just that in certain (in practice most)

Re: [avr-gcc-list] May avr-gcc emit EIJMP/EICALL?

2011-10-13 Thread Jan Waclawek
Confused. EIND could be set once at program start (e.g. to 1) and then left so forever but avr-gcc requires EIND = 0? No. You are mixing two independent answers. I was just trying to hint a possible reason why the EI stuff was used at all, a possible idea which might have been abandoned later.

Re: [avr-gcc-list] May avr-gcc emit EIJMP/EICALL?

2011-10-14 Thread Jan Waclawek
So then the binutily have to be fixed. avr-gcc already relies on relaxation. Are you saying that I can't use avr-gcc WITHOUT using -relax on avr-ld? Then avr-gcc or directly avr-ld should at least warn about it, or even better, force it. Nevertheless, I don't think that's a good idea. The

Re: [avr-gcc-list] May avr-gcc emit EIJMP/EICALL?

2011-10-15 Thread Jan Waclawek
of applications is not appropriate for AVRs, and that the existing support for what we discuss here is sufficient. The extended indirect stuff in gcc is already there for a couple of years. Johann was just trying to clean it up, as it appears it is not needed at the present state of affairs. Jan

Re: [avr-gcc-list] May avr-gcc emit EIJMP/EICALL?

2011-11-01 Thread Jan Waclawek
On Tue, 01 Nov 2011 02:06:07 +0100 Georg-Johann Lay a...@gjlay.de wrote: Jan Waclawek schrieb: You have a description of the bug? Just saw a rather lengthy chat on freaks without pointing to the very problem... Actually, the *pointers* were given several times, e.g. in http

Re: [avr-gcc-list] May avr-gcc emit EIJMP/EICALL?

2011-11-06 Thread Jan Waclawek
Johann, thanks for explaining me how to submit a proper binutils bug. I will make use of this information when I will have a bug I want to submit. This time, I simply don't *want* to do it, and I also don't *want* to discuss further my incentives to do or not to do so. Please don't imply I am

Re: [avr-gcc-list] Weird optimization issue with avr-gcc 4.5.3, re naked.

2012-01-27 Thread Jan Waclawek
desire control over code size (and other aspects of the code too), resort to assembler. Jan Waclawek ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Re: [avr-gcc-list] Weird optimization issue with avr-gcc 4.5.3, re naked.

2012-01-27 Thread Jan Waclawek
my wording. Jan Waclawek ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Re: [avr-gcc-list] 'relocation truncated to fit' diagnosis ideas?

2012-05-03 Thread Jan Waclawek
As the first step, I'd recommend you to use a proven toolchain, like WinAVR20100110. I don't say it does not have issues but at least it's not a moving target. The notable two issues I am aware of are a library issue where rjmp/rcall between functions fall too far apart, and a linker bug

Re: [avr-gcc-list] 'relocation truncated to fit' diagnosis ideas?

2012-05-03 Thread Jan Waclawek
Eric, You should consider posting a minimal compilable example exhibiting the problem, together with the command line switches etc. IMHO a better place to do that is the avr-gcc section of avrfreaks' forum, rather than this list. Please don't refer people to post code to AVR Freaks

Re: [avr-gcc-list] avr-ld: Do linker stubs need --relax?

2012-05-04 Thread Jan Waclawek
In support of my arguments: [binutils]/ld/emutempl/avrelf.em contains a specific handler for the case of stubs without relax: static void avr_elf_after_allocation (void) { if (!avr_no_stubs ! RELAXATION_ENABLED) { /* If relaxing, elf32_avr_size_stubs will be called from

[avr-gcc-list] avr-gcc does not throw diagnostics on undefined escape sequences

2012-05-17 Thread Jan Waclawek
, c, d, e, f); printf(buffer); } compiles cleanly with avr-gcc (I tried both 4.2.2 and 4.7.1), even with -std=c99. My understanding of C99, 6.4.4.4, especially footnote 65, indicates, that the \% sequence should result in compiler error. Comments, please? Jan Waclawek

Re: [avr-gcc-list] avr-gcc does not throw diagnostics on undefinedescape sequences

2012-05-17 Thread Jan Waclawek
const char c[] = \%; compile $ gcc file.c -std=c99 -fsyntax-only -pedantic-errors file.c:1:18: unknown escape sequence '\%' Tested with gcc 3.4 and gcc 4.7 My understanding of C99, 6.4.4.4, especially footnote 65, indicates, that the \% sequence should result in compiler error. Yes.

Re: [avr-gcc-list] Handling __flash1 and .trampolines [Was: .trampolines location.]

2012-12-11 Thread Jan Waclawek
* PR13812 .trampolines location in linker script cause internal error: out of range error Dunno if this is still an issue resp. can be solved by a better default linker script. Maybe a user-specific ld script is needed here, too. I'd say, this is not a bug, but abuse of

Re: [avr-gcc-list] ATMega 2560 + RAMPZ + 128Kplus and the realproblem on GCC

2013-04-06 Thread Jan Waclawek
Starting with gcc 4.7.x, code beyond 128 KB works right away provided you link with relaxation turned on Why would relaxation needed to be turned on? That was because of PR 14058, which, I just realized, is already fixed Ah, so. I put up this question already twice, once on

Re: [avr-gcc-list] uint8_t SRAM variable for ATmega328p allocated at0x060 (instead of 0x0100) in avr-gcc 4.6.2, 7.3.2

2013-04-18 Thread Jan Waclawek
http://sourceware.org/bugzilla/show_bug.cgi?id=13697 JW - Original Message --- It appears that a global SRAM uint8_t variable is placed at address 0x060 by avr-gcc versions 4.6.2 and 7.3.2. ___ AVR-GCC-list mailing list

Re: [avr-gcc-list] Is some special attribute or qualifier required tomake C function tables to use the right linker stubs?

2014-05-02 Thread Jan Waclawek
Will avr-gcc use the right relocation when picking one function from the array and calling it? No, the relocation happened earlier, when the function pointer is getting allocated during linking (i.e when the *value* of the function pointer is getting determined). All the function pointers are

Re: [avr-gcc-list] Programming ATMega2560

2014-11-26 Thread Jan Waclawek
What is your avr-gcc version? Jan ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Re: [avr-gcc-list] AVR tool chain on MacOSX

2014-11-27 Thread Jan Waclawek
I googled a lot on this problem and this time tried to build the chain on MacOSX (recipe below). I still hit the same problem. It simply won't build code for the atmega2560 chip! :-( The device list in gcc is in gcc/config/avr/avr-devices.c - can you see atmega2560/2561 there? JW

Re: [avr-gcc-list] ELF R_AVR_13_PCREL Relocation

2015-02-18 Thread Jan Waclawek
No, it's the other way round. The FLASH is 16-bit wide, and the write-to-register logic around LPM provides the byte-access exception. Note how SPM works. JW ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org

Re: [avr-gcc-list] In-line Assembler Code

2015-03-07 Thread Jan Waclawek
the assembly listing is fresh each time I try. Are you sure? Try to add static volatile uint8_t tmp2; tmp2 = __x; into clock_prescale_set() and check what happens with the asm listing. JW ___ AVR-GCC-list mailing list